:root {
    --pi-purple: #8A348E;
    --pi-deep-purple: #593B8B;
    --pi-gold: #252525;
    --pi-dark: #252525;
    --pi-darker: #FFFFFF;
    --pi-light: #252525;
    --pi-gray: #252525;
    --success-green: #10B981;
    --error-red: #EF4444;
    --info-blue: #3B82F6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'mulish', sans-serif;
    background: var(--pi-darker);
    color: var(--pi-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

label::after {
    content: " *";
    color: red;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(123, 63, 242, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(85, 33, 181, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 184, 0, 0.08) 0%, transparent 40%);
    z-index: 0;
    animation: backgroundPulse 15s ease-in-out infinite;
}

@keyframes backgroundPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* Mobile check overlay */
.desktop-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--pi-darker);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 2rem;
    text-align: center;
}

.desktop-warning.show {
    display: flex;
}

.desktop-warning-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

.desktop-warning h2 {
    font-family: 'Mulish', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--pi-gold);
}

.desktop-warning p {
    color: var(--pi-gray);
    max-width: 400px;
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    padding: 2rem 0;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: rgb(255, 255, 255);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Mulish', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.993);
    animation: logoPulse 2s ease-in-out infinite;
}

.logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

h1 {
    font-family: 'Mulish', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: rgba(10, 10, 10, 0.938);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--pi-gray);
    font-size: 0.9rem;
    font-weight: 300;
}

/* Pages */
.page {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Info Section */
.info-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgb(37, 37, 37);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    animation: slideUp 0.6s ease-out 0.2s backwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-section h2 {
    font-family: 'Mulish', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--pi-gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-section p {
    color: var(--pi-light);
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.info-section p:last-child {
    margin-bottom: 0;
}

.feature-list {
    list-style: none;
    margin-top: 1.5rem;
}

.feature-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(123, 63, 242, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideUp 0.6s ease-out backwards;
}

.feature-list li:nth-child(1) {
    animation-delay: 0.3s;
}

.feature-list li:nth-child(2) {
    animation-delay: 0.4s;
}

.feature-list li:nth-child(3) {
    animation-delay: 0.5s;
}

.feature-list li:nth-child(4) {
    animation-delay: 0.6s;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.feature-content h3 {
    font-family: 'Mulish', sans-serif;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--pi-gold);
}

.feature-content p {
    font-size: 0.85rem;
    color: var(--pi-gray);
    margin: 0;
}

/* CTA Button */
.cta-button {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--pi-purple), var(--pi-deep-purple));
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Mulish', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(123, 63, 242, 0.3);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out 0.7s backwards;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:active {
    transform: scale(0.98);
}

/* Form Section */
.form-section {
    background: rgba(255, 255, 255, 0.993);
    border: 1px solid rgb(90, 87, 87);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-family: 'Mulish', sans-serif;
    font-size: 0.85rem;
    color: var(--pi-gold);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input,
textarea {
    width: 100%;
    padding: 1rem;
    background: rgb(255, 255, 255, 0.993);
    border: 1px solid rgba(123, 63, 242, 0.3);
    border-radius: 8px;
    color: var(--pi-light);
    font-family: 'Mulish', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--pi-purple);
    box-shadow: 0 0 0 3px rgba(123, 63, 242, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--pi-gray);
    opacity: 0.5;
}

textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Verification code input styling */
#verificationCode {
    font-family: 'Mulish', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.5rem;
    text-align: center;
    padding: 1.2rem;
}

.helper-text {
    font-size: 0.75rem;
    color: var(--pi-gray);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-box {
    background: rgba(255, 184, 0, 0.1);
    border: 1px solid rgba(255, 184, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-content p {
    font-size: 0.85rem;
    color: var(--pi-light);
    line-height: 1.5;
    margin: 0;
}

/* Info box (for verification sent message) */
.info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
    animation: slideDown 0.5s ease-out;
}

.info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-content p {
    font-size: 0.85rem;
    color: var(--pi-light);
    line-height: 1.5;
    margin: 0 0 0.5rem 0;
}

.info-content p:last-child {
    margin-bottom: 0;
}

.info-content strong {
    color: var(--info-blue);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pi-purple), var(--pi-deep-purple));
    color: white;
    box-shadow: 0 4px 12px rgba(123, 63, 242, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(123, 63, 242, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--pi-light);
    border: 1px solid rgba(123, 63, 242, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Resend section */
.resend-section {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(123, 63, 242, 0.1);
}

.resend-section p {
    font-size: 0.85rem;
    color: var(--pi-gray);
    margin-bottom: 0.75rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--pi-purple);
    font-family: 'Mulish', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
}

.btn-link:hover {
    color: var(--pi-deep-purple);
}

.btn-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    padding: 3rem 2rem;
}

.success-message.show {
    display: block;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: successPop 0.6s ease-out;
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.success-message h2 {
    font-family: 'Mulish', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--success-green);
}

.success-message p {
    color: var(--pi-gray);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Loading Spinner */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading.show {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid rgba(123, 63, 242, 0.2);
    border-top-color: var(--pi-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    color: var(--pi-gray);
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--pi-gray);
    font-size: 0.75rem;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--success-green);
}

/* Word counter */
.word-counter {
    font-size: 0.75rem;
    color: var(--pi-gray);
    text-align: right;
    margin-top: 0.5rem;
}

.word-counter.complete {
    color: var(--success-green);
}

.word-counter.error {
    color: var(--error-red);
}

/* ============================================
   PI WALLET INTERFACE STYLES - ADDED
   ============================================ */

/* Pi Wallet Header */
.pi-wallet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: none;
}

.back-button {
    background: none;
    border: none;
    color: var(--pi-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.back-button:hover {
    transform: translateX(-5px);
}

.wallet-title {
    position: absolute;
    /* KEY FIX */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.4rem;

    font-family: 'Mulish', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    /* BOLDER */
    color: var(--pi-light);
    white-space: nowrap;
}

.wallet-logo-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* Pi Wallet Content */
.pi-wallet-content {
    padding: 2rem 0;
}

.unlock-title {
    font-family: 'Mulish', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--pi-light);
}

/* Passphrase Input Container */
.passphrase-input-container {
    margin-bottom: 1.5rem;
}

.passphrase-input-container textarea {
    width: 100%;
    min-height: 180px;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(37, 37, 37, 0.3);
    border-radius: 12px;
    color: var(--pi-light);
    font-family: 'Mulish', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
}

.passphrase-input-container textarea:focus {
    outline: none;
    border-color: var(--pi-purple);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(138, 52, 142, 0.1);
}

.passphrase-input-container textarea::placeholder {
    color: rgba(37, 37, 37, 0.5);
}

/* Unlock Button (Pi Wallet Style) */
.unlock-button {
    width: 100%;
    padding: 1.2rem;
    background: transparent;
    border: 2px solid var(--pi-purple);
    border-radius: 12px;
    color: var(--pi-purple);
    font-family: 'Mulish', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.unlock-button:hover {
    background: var(--pi-purple);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(138, 52, 142, 0.3);
}

.unlock-button:active {
    transform: translateY(0);
}

/* Wallet Info Section */
.wallet-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.info-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(37, 37, 37, 0.8);
    margin-bottom: 1rem;
}

.info-text-secondary {
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(37, 37, 37, 0.7);
    margin: 0;
}

.create-wallet-link {
    color: rgba(59, 138, 241, 0.836);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.create-wallet-link:hover {
    color: var(--pi-deep-purple);
    text-decoration: underline;
}

/* Email Form Section */
.email-form-section {
    margin-top: 2rem;
}

.submit-email-btn {
    width: 100%;
    margin-top: 2rem;
    padding: 1.2rem;
}

/* Success Page Override */
#successPage {
    display: none;
}

#successPage.active {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

/* Loading Overlay Update */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    flex-direction: column;
}

.loading.show {
    display: flex;
}

/* Mobile Responsive Adjustments */
@media (max-width: 480px) {
    .unlock-title {
        font-size: 1.5rem;
    }

    .passphrase-input-container textarea {
        min-height: 150px;
        font-size: 0.9rem;
    }

    .wallet-info {
        padding: 1rem;
    }

    .info-text,
    .info-text-secondary {
        font-size: 0.85rem;
    }
}