/* ==========================================================================
   Minimalist Log in / Sign up styles — matches the site's dark ink / gold /
   Fraunces theme defined in _Layout.cshtml.
   Shared by: _AuthModal.cshtml, Login.cshtml (fallback), Register.cshtml (fallback)

   Reuses the layout's own CSS custom properties (--ink, --paper, --gold,
   --gold-soft, --line, --line-strong, --text, --text-dim, --font-display)
   when present, with fallback values here so the standalone fallback pages
   (which don't include the layout's <style> block) still render correctly
   on their own.
   ========================================================================== */

:root {
    --ink: #000000;
    --paper: #ffffff;
    --gold: #ffffff;
    --gold-soft: #d6d6d6;
    --line: rgba(255,255,255,0.12);
    --line-strong: rgba(255,255,255,0.22);
    --text: #ffffff;
    --text-dim: rgba(255,255,255,0.60);
    --font-display: 'Fraunces', Georgia, serif;

    --auth-accent: #ff6b6b;
    --auth-accent-bg: rgba(255,107,107,0.12);
    --auth-accent-border: rgba(255,107,107,0.35);
    --auth-ok: #6fd18f;
    --auth-radius: 20px;
}

.auth-font { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* ---- Modal overlay + card (self-contained, no Bootstrap dependency) ---- */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .35s cubic-bezier(.4,0,.2,1);
}

.auth-modal-overlay.is-visible { display: flex; opacity: 1; }

.auth-modal-card {
    position: relative;
    width: min(420px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--ink);
    background-image: radial-gradient(circle at 50% -10%, rgba(255,255,255,.05), transparent 55%);
    border: 1px solid var(--line-strong);
    border-radius: var(--auth-radius);
    padding: 38px 30px 30px;
    box-shadow: 0 40px 90px -20px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.02) inset;
    transform: translateY(18px) scale(.96);
    opacity: 0;
    transition: transform .45s cubic-bezier(.16,1,.3,1), opacity .3s ease;
}

.auth-modal-overlay.is-visible .auth-modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.auth-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: background .25s ease, color .25s ease, transform .3s ease;
}
.auth-modal-close:hover { background: rgba(255,255,255,.08); color: var(--text); transform: rotate(90deg); }

.auth-modal-title {
    font-family: var(--font-display);
    font-weight: 460;
    font-size: 1.55rem;
    color: var(--text);
    text-align: center;
    margin: 4px 0 6px;
    transition: opacity .2s ease;
}

.auth-modal-subtitle {
    text-align: center;
    color: var(--text-dim);
    font-size: .85rem;
    line-height: 1.5;
    margin: 0 0 24px;
    min-height: 2.7em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    transition: opacity .2s ease;
}

/* ---- Tabs (Log in / Sign up), with a sliding underline indicator ---- */
.auth-tabs {
    position: relative;
    display: flex;
    border-bottom: 1px solid var(--line);
    margin-bottom: 26px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0 14px;
    font-size: .92rem;
    font-weight: 500;
    color: var(--text-dim);
    cursor: pointer;
    background: none;
    border: none;
    transition: color .25s ease;
}

.auth-tab.active { color: var(--text); }
.auth-tab:not(.active):hover { color: rgba(255,255,255,.85); }

.auth-tab-indicator {
    position: absolute;
    left: 0; bottom: -1px;
    width: 50%;
    height: 2px;
    background: var(--gold);
    box-shadow: 0 0 8px rgba(255,255,255,.4);
    transform: translateX(0%);
    transition: transform .32s cubic-bezier(.65,0,.35,1);
}

/* ---- Google button (matches the pre-existing .google-btn look) ---- */
.auth-google-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%;
    background: var(--paper);
    color: var(--ink);
    font-weight: 500;
    font-size: .9rem;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 999px;
    margin-bottom: 18px;
    border: none;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
}
.auth-google-btn img { height: 18px; width: 18px; }
.auth-google-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(0,0,0,.4); color: var(--ink); }

.auth-divider {
    text-align: center;
    color: var(--text-dim);
    font-size: .78rem;
    margin: 4px 0 22px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}
.auth-divider span { flex-shrink: 0; }

/* ---- Animated pane viewport: crossfade + slide + height morph between
   the Log in and Sign up forms ---- */
.auth-pane-viewport {
    position: relative;
    overflow: hidden;
    transition: height .32s cubic-bezier(.65,0,.35,1);
}

.auth-pane {
    transition: opacity .26s ease, transform .3s cubic-bezier(.65,0,.35,1);
}

.auth-pane.is-hidden { display: none; }
.auth-pane.auth-pane-exit { opacity: 0; }
.auth-pane.auth-pane-enter { opacity: 0; }
.auth-pane.is-active:not(.auth-pane-enter) { opacity: 1; transform: translateX(0); }

/* Staggered entrance for each field, replayed every time a pane becomes active */
@keyframes authFieldIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.auth-pane.is-active .auth-field,
.auth-pane.is-active .auth-remember-row,
.auth-pane.is-active .auth-submit,
.auth-pane.is-active .auth-switch {
    animation: authFieldIn .38s cubic-bezier(.16,1,.3,1) both;
}

/* ---- Form elements ---- */
.auth-field { margin-bottom: 14px; text-align: left; }

.auth-field label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.auth-input {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 14px 14px;
    font-size: .95rem;
    color: var(--ink);
    background: var(--paper);
    transition: box-shadow .2s ease, transform .15s ease;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,.22);
}

.auth-input.pin-input {
    letter-spacing: 10px;
    font-weight: 700;
    text-align: center;
}

/* Icon accents inside inputs (phone / lock) */
.auth-input-icon-wrap { position: relative; }
.auth-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9a9a9a;
    font-size: .88rem;
    pointer-events: none;
    transition: color .2s ease;
}
.auth-input.has-icon { padding-left: 42px; }
.auth-input-icon-wrap:focus-within .auth-input-icon { color: var(--ink); }
.auth-input.has-icon.pin-input { padding-left: 42px; letter-spacing: 8px; text-align: left; }

.auth-pass-wrap .auth-toggle-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #8a8a8a;
    transition: color .2s ease;
}
.auth-pass-wrap .auth-toggle-icon:hover { color: var(--ink); }

.auth-status { font-size: .78rem; margin-top: 6px; min-height: 18px; color: var(--text-dim); }
.auth-status.ok { color: var(--auth-ok); }
.auth-status.bad { color: var(--auth-accent); }

.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 20px;
    font-size: .85rem;
    color: var(--text-dim);
}

.auth-remember-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.auth-remember-row input[type="checkbox"] { accent-color: var(--gold); width: 15px; height: 15px; cursor: pointer; }
.auth-remember-row a { color: var(--text); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--line-strong); transition: border-color .2s ease; }
.auth-remember-row a:hover { border-color: var(--text); }

.auth-submit {
    width: 100%;
    background: var(--gold);
    color: var(--ink);
    border: none;
    border-radius: 999px;
    padding: 14px;
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background .2s ease, transform .18s ease, box-shadow .25s ease;
}

.auth-submit:hover:not(:disabled) {
    background: var(--gold-soft);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -10px rgba(255,255,255,.35);
}
.auth-submit:active:not(:disabled) { transform: translateY(0); }
.auth-submit:disabled { opacity: .55; cursor: default; }

.auth-error-box {
    background: var(--auth-accent-bg);
    border: 1px solid var(--auth-accent-border);
    color: var(--auth-accent);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: .85rem;
    margin-bottom: 16px;
    text-align: left;
}
.auth-error-box a { color: var(--text); }

.auth-switch { text-align: center; font-size: .85rem; color: var(--text-dim); margin-top: 14px; }
.auth-switch a, .auth-switch-link {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

/* ---- Success / welcome step (post sign-up) ---- */
.auth-success {
    text-align: center;
    padding: 6px 0 4px;
    transition: opacity .3s ease, transform .3s cubic-bezier(.16,1,.3,1);
}
.auth-success-icon {
    width: 68px; height: 68px; border-radius: 50%;
    background: rgba(111,209,143,0.14);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: var(--auth-ok);
    animation: authSuccessPulse 1.6s ease-in-out infinite;
}
@keyframes authSuccessPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(111,209,143,0.28); }
    50% { box-shadow: 0 0 0 10px rgba(111,209,143,0); }
}
.auth-success h4 { font-family: var(--font-display); font-weight: 440; color: var(--text); margin-bottom: 6px; }
.auth-success p { color: var(--text-dim); font-size: .9rem; }
.auth-creds-box {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 16px 0;
    text-align: left;
}
.auth-creds-box .row-line { display: flex; justify-content: space-between; padding: 3px 0; font-size: .85rem; }
.auth-creds-box .row-line span:first-child { color: var(--text-dim); font-weight: 500; }
.auth-creds-box .row-line span:last-child { color: var(--text); font-weight: 600; }

/* ---- Standalone fallback page wrapper (Login.cshtml / Register.cshtml) ---- */
.auth-standalone-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    margin: 0;
    padding: 20px;
}

.auth-standalone-card {
    width: 100%;
    max-width: 420px;
    background: var(--ink);
    border-radius: var(--auth-radius);
    padding: 36px 30px 30px;
    box-shadow: 0 40px 80px -20px rgba(0,0,0,.6);
    border: 1px solid var(--line-strong);
}

.auth-standalone-card .brand-logo { height: 40px; display: block; margin: 0 auto 18px; filter: brightness(0) invert(1); }
.auth-standalone-card h2 {
    font-family: var(--font-display); font-weight: 440;
    font-size: 1.4rem; text-align: center; margin-bottom: 6px; color: var(--text);
}
.auth-standalone-card .subtitle { text-align: center; color: var(--text-dim); font-size: .88rem; margin-bottom: 24px; }

/* ---- Minimal fallbacks for the couple of Bootstrap utility classes the
   auth forms use for their button loading state (.d-none / .spinner-border).
   This layout doesn't load Bootstrap CSS, so these are defined here instead
   of pulling in the whole framework just for a spinner. ---- */
.d-none { display: none !important; }

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: -0.125em;
    border: .18em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: auth-spin .75s linear infinite;
}
.spinner-border-sm { width: .85rem; height: .85rem; border-width: .15em; }

@keyframes auth-spin { to { transform: rotate(360deg); } }
