body.pebble-auth {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--pebble-ink);
    background:
        radial-gradient(900px 440px at 78% 12%, rgba(196, 138, 78, 0.18), transparent 68%),
        radial-gradient(860px 420px at 16% 86%, rgba(27, 43, 36, 0.1), transparent 70%),
        var(--pebble-bg);
}

.auth-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.auth-nav {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    width: min(1120px, calc(100% - 48px));
    height: 58px;
    padding: 0 18px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--pebble-border);
    border-radius: 16px;
    background: var(--pebble-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 14px 30px rgba(27, 43, 36, 0.1), 0 1px 0 rgba(255, 255, 255, 0.45) inset;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--pebble-ink);
    font-family: var(--pebble-sans);
    font-weight: 600;
}

.auth-logo-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.auth-logo .brand-cursive {
    font-size: 30px;
    line-height: 1.18 !important;
    padding-left: 0.04em;
}

.auth-nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.auth-nav-link {
    font-family: var(--pebble-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--pebble-ink-mute);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    transition: color 0.2s var(--pebble-ease), background 0.2s var(--pebble-ease);
}

.auth-nav-link:hover {
    color: var(--pebble-ink);
    background: var(--pebble-surface-2);
}

.auth-toggle {
    border: 1px solid var(--pebble-border);
    background: var(--pebble-surface);
    color: var(--pebble-ink);
    border-radius: 999px;
    padding: 10px 14px;
    font-family: var(--pebble-mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.25s var(--pebble-ease), border-color 0.25s var(--pebble-ease);
}

.auth-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--pebble-ink-mute);
}

.auth-layout {
    position: relative;
    z-index: 2;
    width: min(1120px, calc(100% - 48px));
    margin: 116px auto 48px;
    display: grid;
    grid-template-columns: minmax(300px, 1.1fr) minmax(360px, 460px);
    gap: clamp(28px, 4vw, 58px);
    align-items: stretch;
}

.auth-story {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(26px, 4vw, 40px) clamp(8px, 1.2vw, 14px);
}

.auth-kicker {
    margin: 0 0 18px 0;
    font-family: var(--pebble-mono);
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--pebble-ink-mute);
}

.auth-display {
    margin: 0;
    max-width: 560px;
    font-family: var(--pebble-serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(52px, 7.4vw, 104px);
    line-height: 0.94;
    letter-spacing: -0.03em;
}

.auth-story-copy {
    margin: 24px 0 0 0;
    max-width: 430px;
    font-family: var(--pebble-sans);
    font-size: 17px;
    line-height: 1.72;
    color: var(--pebble-ink-soft);
}

.auth-highlights {
    list-style: none;
    margin: 30px 0 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
    max-width: 430px;
}

.auth-highlights li {
    position: relative;
    padding-left: 18px;
    font-family: var(--pebble-sans);
    font-size: 14px;
    line-height: 1.56;
    color: var(--pebble-ink-soft);
}

.auth-highlights li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 8px;
    height: 8px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    background: rgba(196, 138, 78, 0.9);
}

.auth-panel {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    border: 1px solid var(--pebble-border);
    background: var(--pebble-surface);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: 0 28px 52px rgba(27, 43, 36, 0.14), 0 1px 0 rgba(255, 255, 255, 0.45) inset;
    padding: clamp(30px, 4vw, 42px);
}

.auth-panel::before {
    content: "";
    position: absolute;
    left: -14%;
    top: -20%;
    width: 70%;
    height: 50%;
    background: radial-gradient(circle at center, rgba(196, 138, 78, 0.2), transparent 72%);
    pointer-events: none;
}

.auth-panel::after {
    content: "";
    position: absolute;
    right: -20%;
    bottom: -28%;
    width: 72%;
    height: 56%;
    background: radial-gradient(circle at center, rgba(27, 43, 36, 0.16), transparent 72%);
    pointer-events: none;
}

.auth-header,
.auth-form,
.auth-footnote,
.auth-error {
    position: relative;
    z-index: 1;
}

.auth-panel-kicker {
    margin: 0;
    font-family: var(--pebble-mono);
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--pebble-ink-mute);
}

.auth-title {
    margin: 12px 0 8px 0;
    font-family: var(--pebble-serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(32px, 4vw, 42px);
    line-height: 1.03;
}

.auth-sub {
    margin: 0;
    color: var(--pebble-ink-soft);
    font-family: var(--pebble-sans);
    line-height: 1.7;
}

.auth-error {
    margin: 16px 0 2px;
    border: 1px solid rgba(196, 117, 106, 0.5);
    background: rgba(196, 117, 106, 0.12);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--pebble-rose);
    font-family: var(--pebble-sans);
    font-size: 13px;
}

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

.auth-field label {
    display: block;
    margin-bottom: 8px;
    font-family: var(--pebble-mono);
    font-size: 10px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--pebble-ink-mute);
}

.pebble-input {
    border-bottom-width: 1px;
    border-bottom-color: rgba(27, 43, 36, 0.24);
    font-size: 16px;
    color: var(--pebble-ink);
}

.pebble-input:focus {
    border-bottom-color: var(--pebble-gold);
}

.pebble-input::placeholder {
    color: rgba(74, 94, 85, 0.7);
}

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

.auth-submit {
    min-width: 160px;
}

.auth-inline-link {
    text-decoration: none;
}

.auth-inline-link:hover {
    color: var(--pebble-ink);
}

.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    color: var(--pebble-ink-mute);
    font-family: var(--pebble-mono);
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    background: var(--pebble-border);
}

.auth-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    border-radius: 999px;
    border: 1px solid var(--pebble-border);
    background: var(--pebble-surface-2);
    color: var(--pebble-ink);
    font-family: var(--pebble-sans);
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.22s var(--pebble-ease), border-color 0.22s var(--pebble-ease), background 0.22s var(--pebble-ease);
}

.auth-google:hover {
    transform: translateY(-1px);
    border-color: rgba(196, 138, 78, 0.55);
    background: rgba(196, 138, 78, 0.14);
}

.auth-footnote {
    margin-top: 20px;
    text-align: center;
}

.auth-footnote a {
    color: var(--pebble-ink-mute);
    text-decoration: none;
    font-size: 13px;
}

.auth-footnote a:hover {
    color: var(--pebble-ink);
}

[data-theme="dark"] body.pebble-auth {
    background:
        radial-gradient(900px 440px at 78% 12%, rgba(196, 138, 78, 0.22), transparent 68%),
        radial-gradient(860px 420px at 16% 86%, rgba(196, 117, 106, 0.14), transparent 70%),
        var(--pebble-bg);
}

[data-theme="dark"] .auth-panel {
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(243, 238, 227, 0.16) inset;
}

[data-theme="dark"] .auth-logo-img {
    filter: brightness(0) invert(0.96);
}

[data-theme="dark"] .pebble-input {
    border-bottom-color: rgba(243, 238, 227, 0.24);
}

[data-theme="dark"] .pebble-input::placeholder {
    color: rgba(209, 215, 211, 0.62);
}

@media (max-width: 980px) {
    .auth-layout {
        grid-template-columns: 1fr;
        margin-top: 94px;
        gap: 18px;
    }

    .auth-story {
        padding: 14px 6px 8px;
    }

    .auth-display {
        max-width: none;
    }

    .auth-story-copy,
    .auth-highlights {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .auth-nav {
        width: calc(100% - 22px);
        height: 54px;
        padding: 0 10px 0 10px;
    }

    .auth-logo .brand-cursive {
        font-size: 26px;
    }

    .auth-nav-link {
        display: none;
    }

    .auth-layout {
        width: calc(100% - 22px);
        margin-top: 82px;
        margin-bottom: 24px;
    }

    .auth-story {
        display: none;
    }

    .auth-display {
        font-size: clamp(40px, 12vw, 64px);
    }

    .auth-panel {
        border-radius: 22px;
        padding: 18px 16px;
    }

    .auth-form {
        margin-top: 12px;
        gap: 12px;
    }

    .auth-actions {
        margin-top: 4px;
    }

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

    .auth-submit {
        width: 100%;
        min-width: 0;
    }

    .auth-inline-link {
        text-align: center;
    }

    .auth-footnote {
        margin-top: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-toggle,
    .auth-google {
        transition: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   VERIFICATION PANEL
   Absolutely positioned inside .auth-panel so it cross-fades
   over the existing form content with a blur-in transition.
═══════════════════════════════════════════════════════════════ */

.verify-panel {
    display: none;          /* JS sets display:flex when active */
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: clamp(30px, 4vw, 42px);
    background: var(--pebble-surface);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                filter  0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.verify-panel.active {
    opacity: 1;
    filter: blur(0);
}

/* Eyebrow */
.verify-kicker {
    margin: 0 0 18px;
    font-family: var(--pebble-mono);
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--pebble-ink-mute);
}

/* Heading */
.verify-heading {
    margin: 0 0 14px;
    font-family: var(--pebble-serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(28px, 4vw, 36px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--pebble-ink);
}

/* Sub-label */
.verify-sub {
    margin: 0 0 36px;
    font-family: var(--pebble-sans);
    font-size: 14px;
    line-height: 1.75;
    color: var(--pebble-ink-soft);
}

.verify-email-hint {
    display: block;
    margin-top: 4px;
    font-family: var(--pebble-mono);
    font-size: 12px;
    color: var(--pebble-ink-mute);
    word-break: break-all;
}

/* 6-bubble OTP input row */
.verify-code-wrap {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto 20px;
}

/* Individual digit bubble — squircle, gold border by default */
.verify-digit {
    display: block !important;
    width: 46px !important;
    height: 56px !important;
    flex: 0 0 46px !important;
    min-width: 0 !important;
    border: 2px solid rgba(196, 138, 78, 0.5) !important;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    outline: none;
    font-family: var(--pebble-mono);
    font-size: 1.6rem;
    font-weight: 500;
    text-align: center;
    color: var(--pebble-ink);
    caret-color: var(--pebble-gold);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    -moz-appearance: textfield;
    box-shadow: 0 2px 8px rgba(196, 138, 78, 0.1);
    padding: 0;
    box-sizing: border-box;
}

.verify-digit::-webkit-inner-spin-button,
.verify-digit::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.verify-digit:focus {
    border-color: var(--pebble-gold);
    border-width: 2px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(196, 138, 78, 0.18), 0 2px 8px rgba(196, 138, 78, 0.12);
    transform: translateY(-2px);
}

/* Error state: rose + shake on the whole row */
.verify-digit.error {
    border-color: var(--pebble-rose);
    color: var(--pebble-rose);
}

.verify-code-wrap.shake {
    animation: verify-shake 0.52s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Success state: gold */
.verify-digit.success {
    border-color: var(--pebble-gold);
    border-width: 2px;
    color: var(--pebble-gold);
    background: rgba(196, 138, 78, 0.08);
}

@keyframes verify-shake {
    10%, 90% { transform: translateX(-3px); }
    20%, 80% { transform: translateX(5px);  }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px);  }
}

/* Status text (error message) */
.verify-status {
    min-height: 18px;
    margin: 0 0 18px;
    font-family: var(--pebble-sans);
    font-size: 13px;
    color: var(--pebble-rose);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.verify-status.visible {
    opacity: 1;
}

/* Resend button */
.verify-resend {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--pebble-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--pebble-ink-mute);
    padding: 8px 0;
    transition: color 0.2s ease;
}

.verify-resend:hover:not(:disabled) {
    color: var(--pebble-ink);
}

.verify-resend:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.verify-timer {
    font-family: var(--pebble-mono);
    font-variant-numeric: tabular-nums;
}

/* "Start over" link at the bottom */
.verify-footnote {
    margin-top: 24px;
}

.verify-footnote a {
    font-family: var(--pebble-sans);
    font-size: 13px;
    color: var(--pebble-ink-mute);
    text-decoration: none;
    transition: color 0.2s ease;
}

.verify-footnote a:hover {
    color: var(--pebble-ink);
}

/* Dark mode adjustments */
[data-theme="dark"] .verify-digit {
    border-color: rgba(196, 138, 78, 0.38);
    background: rgba(15, 26, 21, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .verify-digit:focus {
    border-color: var(--pebble-gold);
    background: rgba(196, 138, 78, 0.1);
    box-shadow: 0 0 0 3px rgba(196, 138, 78, 0.22), 0 2px 8px rgba(0, 0, 0, 0.2);
}
