:root {
    --teal: #0FA3A3;
    --teal-dark: #0a2a2a;
    --teal-soft: #E8F7F7;
    --teal-tint: #F3FBFB;
    --charcoal: #1F2933;
    --slate: #6B7280;
    --white: #FFFFFF;
    --off: #F8FAFA;
    --border: #E5E7EB;
    --danger: #DC2626;
    --shadow: 0 22px 50px rgba(31, 41, 51, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Figtree', system-ui, sans-serif;
    color: var(--charcoal);
    background: var(--white);
    overflow-x: hidden;
}

[x-cloak] {
    display: none !important;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
}

.auth-brand-panel {
    position: relative;
    padding: 32px 36px;
    background:
        radial-gradient(circle at 18% 20%, rgba(15, 163, 163, 0.12), transparent 28%),
        linear-gradient(180deg, #0a2a2a 0%, #0a3232 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 52px 52px;
    opacity: 0.35;
    pointer-events: none;
}

.auth-brand-inner,
.auth-brand-footer {
    position: relative;
    z-index: 1;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    text-decoration: none;
}

.auth-logo-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--teal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 30px rgba(15, 163, 163, 0.24);
}

.auth-logo-mark svg {
    width: 18px;
    height: 18px;
}

.auth-logo-name {
    font-family: 'Instrument Serif', serif;
    font-size: 24px;
    line-height: 1;
}

.auth-brand-copy {
    max-width: 420px;
    margin-top: 48px;
}

.auth-brand-copy h1 {
    margin: 0 0 18px;
    font-family: 'Instrument Serif', serif;
    font-size: clamp(48px, 5.2vw, 64px);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

.auth-brand-copy p {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 17px;
    line-height: 1.75;
}

.auth-brand-footer {
    max-width: 420px;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
}

.auth-brand-footer strong {
    display: block;
    color: var(--white);
    font-size: 15px;
    margin-bottom: 4px;
}

.auth-form-panel {
    background: linear-gradient(180deg, #FFFFFF 0%, #FCFEFE 100%);
    padding: 32px 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 760px;
}

.auth-error-banner {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(220, 38, 38, 0.2);
    background: rgba(254, 242, 242, 0.92);
    color: var(--danger);
    font-weight: 600;
    font-size: 14px;
}

.auth-step-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.auth-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 90px;
    position: relative;
    z-index: 1;
}

.auth-step-circle {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 2px solid #D1D5DB;
    color: #94A3B8;
    background: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    transition: all 0.2s ease;
}

.auth-step.active .auth-step-circle {
    border-color: var(--teal);
    color: var(--teal);
    box-shadow: 0 0 0 4px rgba(15, 163, 163, 0.12);
}

.auth-step.done .auth-step-circle {
    border-color: var(--teal);
    background: var(--teal);
    color: var(--white);
}

.auth-step-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--slate);
    text-align: center;
}

.auth-step.active .auth-step-label,
.auth-step.done .auth-step-label {
    color: var(--charcoal);
}

.auth-step-line {
    flex: 1;
    height: 2px;
    background: #E5E7EB;
    border-radius: 999px;
    transform: translateY(-6px);
}

.auth-progress {
    margin-bottom: 28px;
    padding: 16px 18px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 18px 40px rgba(31, 41, 51, 0.06);
}

.auth-progress-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.auth-progress-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--charcoal);
}

.auth-progress-meta {
    font-size: 13px;
    color: var(--slate);
    font-weight: 600;
}

.auth-progress-track {
    height: 8px;
    background: #E5E7EB;
    border-radius: 999px;
    overflow: hidden;
}

.auth-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--teal), var(--teal-dark));
    border-radius: inherit;
    transition: width 0.3s ease;
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

.auth-heading {
    margin: 0 0 8px;
    font-family: 'Instrument Serif', serif;
    font-size: clamp(30px, 3.8vw, 42px);
    line-height: 1;
    letter-spacing: -0.05em;
}

.auth-subtitle {
    margin: 0 0 24px;
    color: var(--slate);
    font-size: 16px;
    line-height: 1.7;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field > span,
.auth-field-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--charcoal);
}

.auth-field-help {
    font-size: 12px;
    color: var(--slate);
    line-height: 1.5;
}

.password-field {
    display: grid;
    gap: 8px;
}

.password-field-label {
    display: grid;
    gap: 8px;
}

.password-field-label > span {
    font-size: 14px;
    font-weight: 700;
    color: var(--charcoal);
}

.password-field-control {
    position: relative;
}

.password-field-input {
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--charcoal);
    padding: 12px 52px 12px 14px;
    font: inherit;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.password-field-input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 163, 163, 0.15);
}

.password-field-input.error {
    border-color: rgba(220, 38, 38, 0.65);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.password-field-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--slate);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.password-field-toggle:hover {
    background: rgba(15, 163, 163, 0.08);
    color: var(--teal-dark);
    border-color: rgba(15, 163, 163, 0.18);
}

.password-field-toggle svg {
    width: 18px;
    height: 18px;
}

.password-field-help {
    font-size: 12px;
    color: var(--slate);
    line-height: 1.5;
}

.password-field-error {
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
    margin-top: -2px;
}

.auth-input,
.auth-select {
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--charcoal);
    padding: 12px 14px;
    font: inherit;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-input:focus,
.auth-select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 163, 163, 0.15);
}

.auth-input.error,
.auth-select.error {
    border-color: rgba(220, 38, 38, 0.65);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.auth-error {
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
    margin-top: -2px;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.auth-button,
.auth-button-secondary {
    min-height: 52px;
    padding: 0 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.auth-button {
    background: var(--teal);
    color: var(--white);
    box-shadow: 0 14px 28px rgba(15, 163, 163, 0.24);
}

.auth-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: var(--teal-dark);
}

.auth-button:disabled {
    opacity: 0.75;
    cursor: progress;
}

.auth-button-secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--charcoal);
}

.auth-button-secondary:hover {
    border-color: rgba(15, 163, 163, 0.25);
    background: var(--teal-tint);
}

.auth-primary-wide {
    width: 100%;
}

.auth-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 14px;
}

.auth-link-row a {
    color: var(--teal-dark);
    text-decoration: none;
    font-weight: 700;
}

.auth-link-row a:hover {
    text-decoration: underline;
}

.auth-toggle-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.auth-toggle {
    min-height: 48px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--slate);
    font-weight: 800;
    cursor: pointer;
    padding: 0 14px;
    transition: all 0.2s ease;
}

.auth-toggle.active {
    border-color: rgba(15, 163, 163, 0.28);
    color: var(--teal-dark);
    background: var(--teal-tint);
    box-shadow: 0 0 0 3px rgba(15, 163, 163, 0.08);
}

.auth-comparison-card {
    border: 1px solid rgba(15, 163, 163, 0.18);
    border-left: 4px solid var(--teal);
    background: var(--teal-tint);
    border-radius: 14px;
    padding: 16px 18px;
    color: var(--charcoal);
}

.auth-comparison-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
}

.auth-comparison-card p {
    margin: 0;
    color: var(--slate);
    font-size: 14px;
    line-height: 1.7;
}

.auth-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.auth-span-2 {
    grid-column: span 2;
}

.auth-mini-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--slate);
    line-height: 1.5;
}

.auth-price-preview {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid rgba(15, 163, 163, 0.18);
    background: rgba(232, 247, 247, 0.7);
}

.auth-price-preview-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--teal-dark);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-price-preview-value {
    font-family: 'Instrument Serif', serif;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--charcoal);
}

.auth-price-preview-copy {
    font-size: 14px;
    line-height: 1.7;
    color: var(--slate);
}

.auth-step-visual {
    margin-top: 16px;
}

.auth-explainer {
    margin-top: 18px;
    border: 1px solid rgba(15, 163, 163, 0.18);
    border-left: 4px solid var(--teal);
    background: var(--teal-tint);
    border-radius: 14px;
    padding: 16px 18px;
}

.auth-explainer-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--teal-dark);
    margin-bottom: 6px;
}

.auth-explainer-copy {
    font-size: 14px;
    line-height: 1.7;
    color: var(--charcoal);
}

.auth-success-panel {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(15, 163, 163, 0.08), transparent 30%),
        linear-gradient(180deg, #0a2a2a 0%, #0b3232 100%);
    color: var(--white);
    display: grid;
    place-items: center;
    padding: 28px;
    text-align: center;
}

.auth-success-card {
    width: 100%;
    max-width: 720px;
}

.auth-success-check {
    width: 94px;
    height: 94px;
    margin: 0 auto 22px;
    border-radius: 999px;
    border: 2px solid rgba(15, 163, 163, 0.38);
    display: grid;
    place-items: center;
    background: rgba(15, 163, 163, 0.08);
    box-shadow: 0 20px 40px rgba(15, 163, 163, 0.12);
    animation: authPop 0.6s ease both;
}

.auth-success-check svg {
    width: 46px;
    height: 46px;
    stroke: var(--teal);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    animation: authDraw 1s ease 0.2s both;
}

.auth-success-title {
    margin: 0 0 16px;
    font-family: 'Instrument Serif', serif;
    font-size: clamp(42px, 5vw, 62px);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.auth-success-copy {
    margin: 0 auto 14px;
    max-width: 560px;
    font-size: 17px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.78);
}

.auth-success-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    margin: 8px 0 26px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.88);
    font-weight: 700;
    font-size: 14px;
}

.auth-success-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-success-button,
.auth-success-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.auth-success-button {
    background: var(--teal);
    color: var(--white);
}

.auth-success-button:hover,
.auth-success-secondary:hover {
    transform: translateY(-1px);
}

.auth-success-secondary {
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--white);
    background: rgba(255, 255, 255, 0.06);
}

.auth-success-small {
    margin-top: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.68);
}

@keyframes authPop {
    from {
        transform: scale(0.88);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes authDraw {
    from {
        stroke-dasharray: 120;
        stroke-dashoffset: 120;
    }
    to {
        stroke-dasharray: 120;
        stroke-dashoffset: 0;
    }
}

@media (max-width: 1024px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        padding: 24px 18px 32px;
    }
}

@media (max-width: 768px) {
    .auth-card {
        max-width: 100%;
    }

    .auth-step-indicator {
        gap: 8px;
    }

    .auth-step {
        min-width: 0;
        flex: 1;
    }

    .auth-step-label {
        font-size: 11px;
    }

    .auth-step-line {
        display: none;
    }

    .auth-form-grid {
        grid-template-columns: 1fr;
    }

    .auth-span-2 {
        grid-column: span 1;
    }

    .auth-actions,
    .auth-success-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-button,
    .auth-button-secondary,
    .auth-success-button,
    .auth-success-secondary {
        width: 100%;
    }

    .auth-primary-wide {
        min-height: 52px;
    }
}
