/* ============================================================
   Auth pages — login, register, profile, account
   LIGHT theme glass cards on cloud bg + black glass buttons.
   ============================================================ */

:root {
    --vdb-bg:        #e8e2d4;
    --vdb-bg-2:      #f3eee2;
    --vdb-glass:     rgba(255, 255, 255, 0.42);
    --vdb-border:    rgba(255, 255, 255, 0.75);
    --vdb-border-2:  rgba(0, 0, 0, 0.08);
    --vdb-text:      #111;
    --vdb-muted:     rgba(20, 20, 20, 0.55);
    --vdb-accent:    #000;        /* black accent on light bg */
    --vdb-accent-2:  #1a1a1a;
    --vdb-danger:    #d9534f;
    --vdb-ok:        #1e7e34;
    --vdb-radius:    16px;
    --vdb-radius-sm: 10px;
    --vdb-shadow:    0 24px 50px -18px rgba(0, 0, 0, 0.3);
}

.auth-body {
    margin: 0;
    min-height: 100vh;
    /* clouds.jpg is served by base.css body::after (position:fixed pseudo-element)
       which works correctly on iOS Safari — background-attachment:fixed does not. */
    background: transparent;
    color: var(--vdb-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    gap: 16px;
}
.auth-brand {
    text-decoration: none;
    color: var(--vdb-text);
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.auth-brand-name {
    font-weight: 700;
    letter-spacing: 0.32em;
    font-size: 13px;
    color: var(--vdb-accent);
}
.auth-brand-slogan {
    font-size: 9px;
    letter-spacing: 0.28em;
    color: var(--vdb-muted);
    margin-top: 2px;
}
.auth-lang {
    display: flex;
    gap: 8px;
}
.auth-lang a {
    color: var(--vdb-muted);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.16em;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all .2s;
}
.auth-lang a:hover { color: var(--vdb-text); }
.auth-lang a.is-active {
    color: var(--vdb-accent);
    border-color: var(--vdb-border);
}

/* Main */
.auth-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: calc(env(safe-area-inset-top) + 88px) 16px 40px; /* top room for fixed topbar incl. notch */
}
@media (max-width: 560px) {
    .auth-main { padding: calc(env(safe-area-inset-top) + 78px) 14px 32px; }
}
@media (max-width: 360px) {
    .auth-main { padding-left: 12px; padding-right: 12px; }
}

/* Glass card — more vertical breathing room, fluid scaling */
.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--vdb-glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--vdb-border-2);
    border-radius: var(--vdb-radius);
    box-shadow: var(--vdb-shadow);
    padding: clamp(34px, 6vw, 52px) clamp(22px, 5vw, 40px);
}
.auth-card.wide { max-width: 720px; }

.auth-card h1 {
    margin: 0 0 6px;
    font-size: 22px;
    letter-spacing: 0.02em;
    font-weight: 600;
}
.auth-card .auth-sub {
    color: var(--vdb-muted);
    font-size: 13px;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* Form — taller fields, more breathing room */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-field label {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--vdb-muted);
}
.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field select {
    appearance: none;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--vdb-radius-sm);
    padding: 13px 14px;
    color: var(--vdb-text);
    /* 16px prevents iOS Safari zoom-on-focus */
    font-size: 16px;
    min-height: 46px;
    transition: border-color .2s, background .2s, box-shadow .2s;
    box-sizing: border-box;
}
.auth-field input:focus,
.auth-field select:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.6);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--vdb-text);
    line-height: 1.4;
}
.auth-check input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--vdb-accent);
}
.auth-check a { color: var(--vdb-accent); }

/* Password strength bar */
.pw-strength {
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}
.pw-strength > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--vdb-danger);
    transition: width .25s, background .25s;
}
.pw-strength-label {
    font-size: 11px;
    color: var(--vdb-muted);
    margin-top: 4px;
    letter-spacing: 0.08em;
}

/* Buttons — BLACK glass design system on light bg (consistent w/ .cta) */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 18px;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.92) 0%, rgba(0, 0, 0, 0.98) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(0, 0, 0, 0.6);
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow:
        0 14px 32px -10px rgba(0, 0, 0, 0.5),
        0 4px 10px -4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.45);
    transition: transform .15s, box-shadow .2s, background .2s;
    box-sizing: border-box;
    min-height: 46px;
}
.auth-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(40, 40, 40, 0.95) 0%, rgba(15, 15, 15, 1) 100%);
    box-shadow:
        0 20px 40px -10px rgba(0, 0, 0, 0.55),
        0 6px 14px -4px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.auth-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.auth-btn.ghost {
    background: rgba(255, 255, 255, 0.45);
    color: var(--vdb-text);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px) saturate(160%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 6px 16px -6px rgba(0, 0, 0, 0.15);
}
.auth-btn.ghost:hover {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(0, 0, 0, 0.2);
}

.auth-btn.danger {
    background: linear-gradient(180deg, rgba(217, 83, 79, 0.92) 0%, rgba(170, 50, 47, 0.98) 100%);
    color: #fff;
    border-color: rgba(170, 50, 47, 0.6);
}
.auth-btn.danger:hover { box-shadow: 0 16px 32px -8px rgba(217, 83, 79, 0.5); }

.auth-btn.google {
    background: rgba(255, 255, 255, 0.92);
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.15);
    text-transform: none;
    letter-spacing: 0.02em;
    box-shadow:
        0 8px 20px -6px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.auth-btn.google:hover { background: rgba(255, 255, 255, 1); }
.auth-btn.google svg { width: 18px; height: 18px; }

/* ---- Passkey / Fingerprint button (hidden by default, shown when supported) ---- */
.auth-btn.passkey {
    background: rgba(255, 255, 255, 0.78);
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.15);
    text-transform: none;
    letter-spacing: 0.02em;
    margin-bottom: 10px;
    display: none;
    box-shadow:
        0 8px 20px -6px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
html.has-passkey .auth-btn.passkey { display: inline-flex; }
.auth-btn.passkey:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}
.auth-btn.passkey svg { width: 18px; height: 18px; }
.auth-btn.passkey:disabled { opacity: .55; cursor: wait; }

/* Status line for passkey actions */
.passkey-status {
    min-height: 1.1em;
    font-size: 12px;
    text-align: center;
    margin: 8px 0;
    letter-spacing: 0.04em;
    transition: color .2s;
}
.passkey-status.ok    { color: var(--vdb-ok, #1e7e34); }
.passkey-status.error { color: var(--vdb-danger, #d9534f); }
.passkey-status:empty { display: none; }

/* ---- Passkey tab visibility ---- */
.passkey-add-btn,
.passkey-unsupported { display: none; }
html.has-passkey .passkey-add-btn { display: inline-flex; }
html.no-passkey .passkey-unsupported { display: block; }
html.no-passkey .passkey-add-btn { display: none !important; }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--vdb-muted);
    font-size: 11px;
    letter-spacing: 0.24em;
    margin: 18px 0;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--vdb-border-2);
}

/* Links row */
.auth-links {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: var(--vdb-muted);
    text-align: center;
}
.auth-links a {
    color: var(--vdb-accent);
    text-decoration: none;
}
.auth-links a:hover { text-decoration: underline; }

/* Alerts */
.auth-alert {
    padding: 12px 14px;
    border-radius: var(--vdb-radius-sm);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 18px;
    border: 1px solid;
}
.auth-alert.error  { background: rgba(255, 93, 93, 0.08);  color: #ffb3b3; border-color: rgba(255, 93, 93, 0.3); }
.auth-alert.ok     { background: rgba(74, 222, 128, 0.08);  color: #a7f3c5; border-color: rgba(74, 222, 128, 0.3); }
.auth-alert.info   { background: rgba(255, 215, 106, 0.08); color: #ffe7a8; border-color: rgba(255, 215, 106, 0.3); }

/* Account / Profile layout */
.account-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}
@media (min-width: 720px) {
    .account-grid { grid-template-columns: 1fr 1fr; }
}
.account-section {
    background: var(--vdb-glass);
    border: 1px solid var(--vdb-border-2);
    border-radius: var(--vdb-radius);
    padding: 22px;
}
.account-section h2 {
    margin: 0 0 14px;
    font-size: 15px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--vdb-accent);
}
.account-meta {
    color: var(--vdb-muted);
    font-size: 12px;
    margin-bottom: 14px;
    line-height: 1.5;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}
.history-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--vdb-border-2);
}
.history-list li:last-child { border-bottom: none; }
.history-list .time { color: var(--vdb-muted); font-variant-numeric: tabular-nums; }

/* Footer is now unified .vdb-footer — styled in footer.css.
   Just ensure the auth-main provides bottom space so content doesn't slide under it. */
.auth-main { padding-bottom: clamp(80px, 13vh, 110px) !important; }

/* Avatar bubble */
.avatar {
    display: inline-block;
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--vdb-bg-2);
    border: 1px solid var(--vdb-border);
    object-fit: cover;
    vertical-align: middle;
}

/* Small helpers */
.muted { color: var(--vdb-muted); font-size: 12px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.row-actions .auth-btn { width: auto; padding: 10px 16px; font-size: 12px; }

/* ============================================================
   Auth welcome header — logo + eyebrow + brand world heading
   ============================================================ */
.auth-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    text-align: center;
}
.auth-welcome img {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18));
}
.auth-eyebrow {
    font-size: 10px;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: var(--vdb-muted);
    font-weight: 600;
}
.auth-welcome h1 {
    margin: 4px 0 0;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--vdb-text);
    line-height: 1.35;
}
.brand-world {
    display: inline-block;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--vdb-accent);
}

/* Divider variant with text via pseudo elements (already covered by .auth-divider) */
.auth-divider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--vdb-muted);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 18px 0;
}
.auth-divider-row::before,
.auth-divider-row::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--vdb-border-2);
}

/* Refine the auth-card on top so welcome reads clearly */
.auth-card .auth-welcome + .auth-alert { margin-top: 4px; }

/* Light-theme tuning for alert colors (originally dark-theme inherited) */
.auth-alert.error { background: rgba(217, 83, 79, 0.10); color: #8a2a26; border-color: rgba(217, 83, 79, 0.35); }
.auth-alert.ok    { background: rgba(30, 126, 52, 0.10); color: #1e5e2b; border-color: rgba(30, 126, 52, 0.35); }
.auth-alert.info  { background: rgba(180, 140, 40, 0.10); color: #6b4e10; border-color: rgba(180, 140, 40, 0.35); }

/* ============================================================
   Profile / Account tabs — COMPACT (v20)
   Tighter padding + spacing; avatar is a clickable upload thumb.
   ============================================================ */

.profile-card {
    max-width: 480px;
    padding: 18px 18px 20px;
}
/* Extra-tight variant — the compact /profile redesign */
.profile-card--compact { padding: 16px 16px 18px; }

.profile-bar {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 2px 2px 11px;
    border-bottom: 1px solid var(--vdb-border-2);
    margin-bottom: 11px;
}

/* --- Avatar upload thumbnail (clickable) --- */
.profile-avatar-btn {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s;
}
.profile-avatar-btn:hover { transform: scale(1.04); }
.profile-avatar-btn:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.5);
    outline-offset: 2px;
}
.profile-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.08);
    flex: 0 0 auto;
    display: block;
}
.profile-avatar--initial {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 0.04em;
}
.profile-avatar-btn .profile-avatar--initial {
    position: absolute;
    inset: 0;
}
/* Camera badge — bottom-right corner of the avatar */
.profile-avatar-cam {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 19px;
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #000;
    color: #fff;
    border: 2px solid var(--vdb-bg-2, #f3eee2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.profile-avatar-cam svg { width: 11px; height: 11px; }
/* Busy state — dim + spinner while uploading */
.profile-avatar-btn.is-busy { cursor: progress; pointer-events: none; }
.profile-avatar-btn.is-busy .profile-avatar { opacity: .45; }
.profile-avatar-btn.is-busy::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.25);
    border-top-color: #000;
    animation: auth-spin 0.8s linear infinite;
}

.profile-bar-info { flex: 1; min-width: 0; }
.profile-bar-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--vdb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-bar-meta {
    font-size: 11px;
    color: var(--vdb-muted);
    margin-top: 2px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}
.badge-verified, .badge-unverified {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    padding: 2px 7px;
    border-radius: 999px;
    text-transform: uppercase;
}
.badge-verified   { background: rgba(30, 126, 52, 0.14); color: var(--vdb-ok); }
.badge-unverified { background: rgba(217, 83, 79, 0.14); color: var(--vdb-danger); }

.profile-bar-actions {
    display: flex;
    gap: 3px;
    flex: 0 0 auto;
}
.profile-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--vdb-muted);
    text-decoration: none;
    transition: color .15s, background .15s;
}
.profile-action:hover {
    color: var(--vdb-text);
    background: rgba(0, 0, 0, 0.04);
}
.profile-action svg { opacity: .75; }

/* Inline avatar upload status line */
.avatar-status {
    font-size: 11.5px;
    line-height: 1.4;
    letter-spacing: 0.02em;
    margin: 0 0 10px;
    padding: 7px 11px;
    border-radius: 9px;
    border: 1px solid;
}
.avatar-status:empty { display: none; }
.avatar-status        { background: rgba(0, 0, 0, 0.04); color: var(--vdb-muted); border-color: rgba(0, 0, 0, 0.08); }
.avatar-status.ok     { background: rgba(30, 126, 52, 0.10); color: #1e5e2b; border-color: rgba(30, 126, 52, 0.30); }
.avatar-status.error  { background: rgba(217, 83, 79, 0.10); color: #8a2a26; border-color: rgba(217, 83, 79, 0.32); }

/* Tabs (glass pills, URL-driven) — tighter */
.profile-tabs {
    display: flex;
    gap: 3px;
    padding: 3px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    margin-bottom: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.profile-tabs a {
    flex: 1 1 0;
    text-align: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--vdb-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.profile-tabs a:hover { color: var(--vdb-text); }
.profile-tabs a[aria-current="page"] {
    background: #000;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Form inside tab — compact */
.profile-form { gap: 0; }
.profile-form .auth-field { margin-bottom: 10px; }
.profile-form .auth-field:last-of-type { margin-bottom: 0; }
.profile-form .auth-field input[type="text"],
.profile-form .auth-field input[type="email"],
.profile-form .auth-field input[type="password"],
.profile-form .auth-field select {
    padding: 10px 13px;
    min-height: 42px;
}
.profile-form .auth-btn { margin-top: 12px; }
.profile-form-note {
    font-size: 12px;
    color: var(--vdb-muted);
    line-height: 1.45;
    margin: 0 0 11px;
}
.profile-form-hint {
    font-size: 11.5px;
    color: var(--vdb-muted);
    line-height: 1.45;
    margin: 10px 0 0;
}
.profile-toggle {
    margin: 4px 0 0;
    padding: 11px 13px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 11px;
}

/* Account tab — E-Mail + Passwort stacked in one tab */
.profile-section { margin: 0; }
.profile-section-title {
    margin: 0 0 9px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--vdb-accent);
}
.profile-section-divider {
    height: 1px;
    background: var(--vdb-border-2);
    margin: 16px 0;
}

/* Passkey list — compact rows */
.passkey-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}
.passkey-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    margin-bottom: 7px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 11px;
}
.passkey-row:last-child { margin-bottom: 0; }
.passkey-row-icon { flex: 0 0 auto; opacity: 0.7; }
.passkey-row-info { flex: 1; min-width: 0; }
.passkey-row-name { font-weight: 600; font-size: 12.5px; }
.passkey-row-meta {
    font-size: 10.5px;
    color: var(--vdb-muted);
    margin-top: 2px;
}
.passkey-row-del {
    width: auto;
    padding: 6px 12px;
    font-size: 10.5px;
    min-height: 0;
    flex: 0 0 auto;
    background: rgba(217, 83, 79, 0.9);
    border-color: rgba(170, 50, 47, 0.6);
}

@media (max-width: 560px) {
    .profile-card,
    .profile-card--compact { padding: 13px 13px 16px; max-width: 100%; }
    .profile-bar { gap: 9px; padding-bottom: 10px; margin-bottom: 10px; }
    .profile-avatar-btn,
    .profile-avatar { width: 42px; height: 42px; }
    .profile-avatar--initial { font-size: 15px; }
    .profile-bar-name { font-size: 13px; }
    .profile-bar-meta { font-size: 10.5px; gap: 5px; }
    .badge-verified, .badge-unverified { font-size: 8.5px; padding: 2px 6px; }
    .profile-bar-actions .profile-action span { display: none; }
    .profile-bar-actions .profile-action { padding: 5px 7px; }
    .profile-tabs a { padding: 8px 9px; font-size: 10.5px; letter-spacing: 0.05em; min-height: 36px; }
    .profile-form .auth-field label { font-size: 10px; letter-spacing: 0.11em; }
    .profile-form .auth-field input,
    .profile-form .auth-field select { font-size: 16px; padding: 10px 12px; min-height: 44px; }
    .profile-form-note { font-size: 11.5px; }
}

/* ============================================================
   Polish — entrance animations + loading states + focus glow
   ============================================================ */

/* Card slides up + fades in on first paint */
.auth-card {
    animation: auth-card-enter 0.7s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes auth-card-enter {
    0%   { opacity: 0; transform: translateY(14px) scale(0.985); }
    100% { opacity: 1; transform: none; }
}

/* Input focus — soft glass-glow ring instead of harsh outline */
.auth-field input[type="text"]:focus,
.auth-field input[type="email"]:focus,
.auth-field input[type="password"]:focus,
.auth-field select:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.55);
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 0 0 4px rgba(0, 0, 0, 0.05),
        0 4px 16px -8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}
.auth-field input,
.auth-field select {
    transition: border-color .2s, background .2s, box-shadow .25s, transform .2s;
}

/* Auth-Button — loading state morphs button → spinner */
.auth-btn {
    position: relative;
    overflow: hidden;
}
.auth-btn.is-loading {
    pointer-events: none;
    color: transparent !important;
}
.auth-btn.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    margin-left: -9px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    animation: auth-spin 0.85s linear infinite;
}
@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* Subtle shimmer across the button while loading (sweeps every 1.4s) */
.auth-btn.is-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        transparent 30%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 70%
    );
    background-size: 200% 100%;
    animation: auth-btn-shimmer 1.4s linear infinite;
    pointer-events: none;
}
@keyframes auth-btn-shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

/* Field-level shimmer for AJAX inline updates */
.auth-field.is-loading input {
    background-image: linear-gradient(
        100deg,
        rgba(255,255,255,0.7) 0%,
        rgba(255,255,255,0.9) 50%,
        rgba(255,255,255,0.7) 100%);
    background-size: 200% 100%;
    animation: auth-field-shimmer 1.2s linear infinite;
}
@keyframes auth-field-shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

/* Alert entrance — slide-in from top */
.auth-alert {
    animation: auth-alert-enter 0.4s var(--ease-out, ease) both;
}
@keyframes auth-alert-enter {
    0%   { opacity: 0; transform: translateY(-8px); }
    100% { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card,
    .auth-alert { animation: none !important; }
    .auth-btn.is-loading::before { animation: none; }
}

/* ============================================================
   Register page — Google as the primary path, email secondary
   ============================================================ */
.auth-btn-primary {
    padding-top: 16px;
    padding-bottom: 16px;
    font-size: 14.5px;
    box-shadow:
        0 12px 28px -8px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.auth-btn-primary svg { width: 20px; height: 20px; }
.auth-primary-hint {
    text-align: center;
    font-size: 11.5px;
    color: var(--vdb-muted);
    letter-spacing: 0.04em;
    margin: 9px 0 2px;
}
/* The email form reads as the secondary route — its submit is a ghost
   button so Google clearly stays the main call to action. */
.auth-form--secondary .auth-btn.ghost {
    margin-top: 2px;
}

/* ============================================================
   Login / Register mode toggle — one combined auth experience
   ============================================================ */
.auth-mode-toggle {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 0 0 20px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 999px;
}
.auth-mode-tab {
    flex: 1 1 0;
    text-align: center;
    padding: 11px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--vdb-muted);
    text-decoration: none;
    transition: background .25s ease, color .2s ease, box-shadow .25s ease;
}
.auth-mode-tab:hover { color: var(--vdb-text); }
.auth-mode-tab.is-active {
    background: #000;
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.45);
}
@media (prefers-reduced-motion: reduce) {
    .auth-mode-tab { transition: none; }
}

/* ============================================================
   Compact combined auth — method switch (Google / E-Mail)
   ============================================================ */
.auth-card--compact {
    max-width: 420px;
    padding: clamp(22px, 5vw, 34px) clamp(20px, 5vw, 30px);
    /* Always square — content is centred; a tall form (register) lets it grow */
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* Login / Register box vertically centred in the viewport */
.page-login .auth-main,
.page-register .auth-main {
    /* 'safe' keeps a tall (register) box reachable instead of clipping its top */
    align-items: safe center;
}
.auth-card--compact .auth-welcome {
    margin-bottom: 14px;
    gap: 4px;
}
.auth-card--compact .auth-welcome img {
    width: 46px;
    height: 46px;
}
.auth-card--compact .auth-welcome h1 {
    font-size: 15px;
    margin: 2px 0 0;
}
.auth-card--compact .auth-mode-toggle {
    margin-bottom: 10px;
}
.auth-card--compact .auth-form {
    gap: 13px;
}

/* Method switch — two side-by-side buttons; the active one reads as raised */
.auth-method-switch {
    display: flex;
    gap: 6px;
    margin: 0 0 14px;
}
.auth-method-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.5);
    color: var(--vdb-muted);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.auth-method-btn:hover { color: var(--vdb-text); }
.auth-method-btn.is-active {
    background: #fff;
    color: var(--vdb-text);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 5px 14px -6px rgba(0, 0, 0, 0.3);
}
.auth-method-btn svg { flex-shrink: 0; }

/* Method panels — only the active one is shown */
.auth-method[hidden] { display: none; }
.auth-method { animation: auth-method-in .28s var(--ease-out, ease) both; }
@keyframes auth-method-in {
    0%   { opacity: 0; transform: translateY(4px); }
    100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-method-btn { transition: none; }
    .auth-method { animation: none; }
}
