html {
    background-color: #f4f8fb;
}

body {
    opacity: 0;
    transition: opacity 0.35s ease-in-out;
    visibility: hidden;
}

body.auth-resolved {
    opacity: 1 !important;
    visibility: visible !important;
}

.auth-main-wrapper {
    width: min(92%, 580px);
    max-width: 580px;
    margin: 0 auto;
}

.auth-container {
    width: 100%;
    max-width: 100%;
    gap: 14px;
}

.auth-card {
    padding: 2rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background-color: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.auth-card.secondary {
    padding: 1rem 1.5rem;
}

.auth-header {
    margin: 0 0 1.5rem;
    text-align: center;
}

.auth-header i {
    color: #0ea5e9;
    font-size: 2.9rem;
    margin-bottom: 0.7rem;
    filter: drop-shadow(0 3px 8px rgba(14, 165, 233, 0.28));
}

.auth-header h1 {
    margin-bottom: 0.4rem;
    font-weight: 800;
    font-size: 2rem;
    color: #0f172a;
    font-family: 'Outfit', sans-serif;
}

.auth-header p {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
    text-align: left;
}

.field-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid #d8e2ec;
    background: #fbfdff;
    border-radius: 12px;
    font-size: 0.92rem;
    color: #0f172a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder {
    color: #94a3b8;
    font-size: 0.86rem;
}

.form-group input:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
    outline: none;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 69%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-btn {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
    font-size: 0.97rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.3rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    color: #f8fafc;
    box-shadow: 0 8px 18px rgba(14, 165, 233, 0.25);
}

.auth-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
    box-shadow: 0 10px 22px rgba(14, 165, 233, 0.28);
}

.auth-btn:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.45);
    outline-offset: 2px;
}

.auth-btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
}

.status-msg {
    margin-bottom: 1rem;
    font-size: 0.84rem;
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    text-align: left;
    border: 1px solid transparent;
    background: rgba(248, 250, 252, 0.95);
}

.status-msg.error {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.25);
    background: rgba(254, 242, 242, 0.9);
}

.status-msg.success {
    color: #047857;
    border-color: rgba(4, 120, 87, 0.2);
    background: rgba(236, 253, 245, 0.92);
}

.signup-progress-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.4rem;
}

.signup-progress {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: transform 0.2s ease, background 0.2s ease;
}

.progress-dot.active {
    background: #0ea5e9;
    transform: scale(1.2);
}

.progress-dot.complete {
    background: #14b8a6;
}

.step-label {
    font-size: 0.76rem;
    color: #64748b;
    font-weight: 600;
}

.signup-step {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.signup-step.is-active {
    opacity: 1;
    transform: translateY(0);
}

.signup-step h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.step-description {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1.15rem;
    line-height: 1.5;
}

.signup-primary-choice {
    margin-top: 0.35rem;
}

.signup-section-label {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f766e;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#signup-step-1 .social-auth-btn {
    margin-bottom: 0.1rem;
}

.account-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 0.9rem 0 1.2rem;
}

.mode-card {
    text-align: left;
    border: 1px solid #dbe3ef;
    background: #f9fcff;
    border-radius: 14px;
    padding: 0.95rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.mode-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.45rem;
}

.mode-card p {
    font-size: 0.84rem;
    color: #475569;
    line-height: 1.45;
}

.mode-card:hover {
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.mode-card.selected {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.26), 0 10px 20px rgba(14, 165, 233, 0.18);
    transform: scale(1.015);
}

#recovery-mode.selected {
    border-color: #14b8a6;
    box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.34), 0 12px 24px rgba(20, 184, 166, 0.2);
}

.recovery-mode-notice {
    margin: 0.2rem 0 1.15rem;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    border: 1px solid rgba(20, 184, 166, 0.4);
    background: linear-gradient(145deg, rgba(20, 184, 166, 0.12), rgba(14, 165, 233, 0.08));
    color: #0f766e;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.recovery-mode-notice.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.signup-language-card {
    margin-top: 1.25rem;
    padding: 0.82rem 0.88rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 13px;
    background: rgba(247, 251, 255, 0.92);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.signup-section-divider {
    height: 1px;
    margin: 1.28rem 0 1.06rem;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0), rgba(148, 163, 184, 0.38), rgba(148, 163, 184, 0));
}

.a11y-signup-section {
    margin-top: 0;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.72);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
    padding: 0.68rem 0.76rem;
}

.signup-consent-card {
    margin-top: 1rem;
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 12px;
    background: rgba(124, 58, 237, 0.06);
    padding: 0.75rem 0.85rem;
}

.signup-consent-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.86rem;
    color: #334155;
    font-weight: 600;
    cursor: pointer;
}

.signup-consent-row input {
    margin-top: 2px;
}

.signup-consent-help {
    margin: 8px 0 0 28px;
    font-size: 0.75rem;
    color: #64748b;
}

.a11y-optional-label {
    margin: 0 0 0.38rem;
    font-size: 0.74rem;
    color: #64748b;
    font-weight: 600;
}

.a11y-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: none;
    background: transparent;
    padding: 0.15rem;
    color: #1e293b;
    font-size: 0.89rem;
    font-weight: 600;
    cursor: pointer;
}

.a11y-toggle:focus-visible {
    outline: 2px solid rgba(14, 165, 233, 0.4);
    outline-offset: 2px;
    border-radius: 8px;
}

.a11y-caret {
    font-size: 0.8rem;
    color: #64748b;
    transition: transform 0.24s ease;
}

.a11y-toggle[aria-expanded="true"] .a11y-caret {
    transform: rotate(180deg);
}

.a11y-section-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.24s ease, padding-top 0.24s ease;
}

.a11y-section-content.open {
    opacity: 1;
    padding-top: 0.62rem;
}

.a11y-section-subtitle {
    font-size: 0.77rem;
    color: #64748b;
    margin-bottom: 0.6rem;
    line-height: 1.45;
}

.a11y-language-label {
    display: block;
    font-size: 0.79rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.32rem;
}

.a11y-language-select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: #ffffff;
    border-radius: 10px;
    padding: 0.54rem 0.7rem;
    font-size: 0.84rem;
    font-family: 'Outfit', sans-serif;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.a11y-language-select:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16);
}

.a11y-language-helper {
    margin: 0 0 0.46rem;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

.signup-a11y-list {
    display: grid;
    gap: 0.48rem;
}

.signup-a11y-card {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: start;
    gap: 0.6rem;
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    padding: 0.58rem 0.62rem;
    background: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.signup-a11y-card:hover,
.signup-a11y-card:focus-within {
    border-color: rgba(14, 165, 233, 0.34);
    background: rgba(240, 249, 255, 0.88);
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.08);
}

.signup-a11y-card.is-enabled {
    border-color: rgba(20, 184, 166, 0.42);
    background: rgba(236, 253, 250, 0.92);
}

.a11y-icon-pill {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(186, 230, 253, 0.45);
    color: #0369a1;
    font-size: 0.88rem;
}

.signup-a11y-copy {
    display: grid;
    gap: 0.15rem;
    padding-top: 0.02rem;
}

.signup-a11y-title {
    font-size: 0.84rem;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.35;
}

.signup-a11y-desc {
    font-size: 0.76rem;
    color: #334155;
    line-height: 1.4;
}

.signup-a11y-control {
    position: relative;
    width: 46px;
    height: 28px;
    margin-top: 2px;
}

.signup-a11y-control input[type="checkbox"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.signup-a11y-switch {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #cfd8e6;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.signup-a11y-switch::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s ease;
}

.signup-a11y-control input[type="checkbox"]:checked + .signup-a11y-switch {
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
}

.signup-a11y-control input[type="checkbox"]:checked + .signup-a11y-switch::before {
    transform: translateX(18px);
}

.signup-a11y-control input[type="checkbox"]:focus-visible + .signup-a11y-switch {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.a11y-lowvision-hint {
    margin: 0.1rem 0 0.22rem;
    padding: 0.46rem 0.58rem;
    border-radius: 10px;
    border: 1px dashed rgba(14, 165, 233, 0.28);
    background: rgba(240, 249, 255, 0.72);
    color: #0369a1;
    font-size: 0.75rem;
    font-weight: 600;
    display: none;
}

.a11y-lowvision-hint.is-visible {
    display: block;
}

.signup-terms {
    margin: 1.3rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
}

.policy {
    color: #334155;
    text-decoration: none;
}

.policy:hover,
.policy:focus-visible {
    color: #2563eb;
    text-decoration: underline;
}

.signup-controls {
    margin-top: 1rem;
    display: grid;
    gap: 0.7rem;
}

#signup-form[data-current-step="3"] .signup-terms {
    margin-top: 1.45rem;
}

#signup-form[data-current-step="3"] .signup-controls {
    margin-top: 1.35rem;
    padding-top: 0.95rem;
    border-top: 1px solid rgba(148, 163, 184, 0.28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.96) 26%);
}

.step-back-btn {
    width: fit-content;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    padding: 0.46rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.step-back-btn:hover {
    border-color: #0ea5e9;
    color: #0369a1;
}

.signup-cta {
    margin-top: 0;
    padding: 1rem 1.2rem;
    box-shadow: 0 12px 28px rgba(14, 165, 233, 0.28);
}

.auth-footer {
    color: #334155;
    margin: 0;
}

.toggle-form {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 600;
}

.toggle-form:hover {
    text-decoration: underline;
}

@media (max-width: 700px) {
    .auth-main-wrapper {
        width: min(92%, 520px);
    }

    .auth-card {
        padding: 1.5rem 1.2rem;
        border-radius: 16px;
    }

    .account-mode-grid {
        grid-template-columns: 1fr;
    }

    .signup-step h2 {
        font-size: 1.28rem;
    }

    .signup-language-card {
        padding: 0.76rem 0.78rem;
    }

    .signup-a11y-card {
        grid-template-columns: 32px 1fr auto;
        gap: 0.52rem;
    }

    #signup-form[data-current-step="3"] .signup-controls {
        position: sticky;
        bottom: 0;
        z-index: 3;
        padding-bottom: 0.2rem;
    }
}

@media (max-width: 420px) {
    .auth-main-wrapper {
        width: 94%;
    }

    .auth-header h1 {
        font-size: 1.8rem;
    }

    .auth-header i {
        font-size: 2.45rem;
    }

    .step-back-btn {
        width: 100%;
    }

    .signup-a11y-card {
        grid-template-columns: 30px 1fr auto;
        border-radius: 11px;
        padding: 0.55rem;
    }

    .signup-a11y-control {
        width: 44px;
    }

    .signup-a11y-switch::before {
        width: 21px;
        height: 21px;
    }
}
