/**
 * Login / registration page (views/login.ejs).
 *
 * Speaks in the homepage's voice (homepage/assets/css/brand.v2.css): a navy
 * hero with the paddock photo and a gold eyebrow on one side, the form on a
 * cream well on the other. Colour values mirror the buyer design layer in
 * auction-shared.css; fonts and figures come only from typography.css tokens.
 *
 * Tabler is still loaded underneath for the spinner, d-none and the toasts,
 * so the form controls are restyled here under .auth-page.
 */

.auth-page {
    --ink: #16202d;
    --ink-2: #364253;
    --ink-3: #566273;
    --ink-4: #8b94a1;
    --navy: #16202d;
    --cream: #faf8f3;
    --cream-2: #f3efe4;
    --gold: #d4af37;
    --gold-soft: #e9d48a;
    --gold-ink: #8a6d12;
    --gold-line: rgba(184, 148, 31, 0.5);
    --line: rgba(22, 32, 45, 0.1);
    --line-strong: rgba(22, 32, 45, 0.18);
    --radius-card: 10px;
    --radius-control: 8px;
    --ease: cubic-bezier(0.165, 0.84, 0.44, 1);

    min-height: 100vh;
    margin: 0;
    background: var(--cream);
    color: var(--ink-2);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

.auth-page ::selection {
    background: var(--gold-soft);
    color: var(--ink);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    min-height: 100vh;
}

/* ===========================================
   HERO (left)
   =========================================== */

.auth-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
    padding: 48px 56px;
    color: var(--cream);
    background: var(--navy) url("/assets/img/hero-bg2.jpg") center right / cover no-repeat;
    overflow: hidden;
    isolation: isolate;
}

.auth-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 85% 15%, rgba(212, 175, 55, 0.14), transparent 55%),
        linear-gradient(100deg, rgba(16, 24, 35, 0.96) 0%, rgba(16, 24, 35, 0.86) 50%, rgba(16, 24, 35, 0.62) 100%);
}

/* Gold hairline where the hero meets the form */
.auth-hero::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--gold-line), transparent);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    align-self: flex-start;
    color: #fff;
    text-decoration: none;
}

.auth-brand:hover {
    color: #fff;
}

.auth-brand .logo-mark {
    width: 10px;
    height: 10px;
    background: var(--gold);
    transform: rotate(45deg);
    flex-shrink: 0;
}

.auth-brand .sitename {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 22px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
}

.auth-eyebrow::before {
    content: "";
    width: 36px;
    height: 1px;
    background: var(--gold);
}

.auth-hero h1 {
    margin: 0;
    max-width: 28rem;
    font-family: var(--font-display);
    font-size: clamp(34px, 3.6vw, 52px);
    font-weight: 500;
    line-height: 1.04;
    letter-spacing: -0.005em;
    color: #fff;
}

.auth-lead {
    margin: 24px 0 0;
    max-width: 26rem;
    font-size: 17px;
    line-height: 1.6;
    color: rgba(250, 248, 243, 0.78);
}

.auth-hero-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding-top: 20px;
    max-width: 26rem;
    border-top: 1px solid rgba(250, 248, 243, 0.14);
    font-size: 14px;
    color: rgba(250, 248, 243, 0.62);
}

.auth-hero-foot i {
    color: var(--gold);
    font-size: 16px;
}

/* ===========================================
   FORM SIDE (right)
   =========================================== */

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.auth-panel {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: 0 1px 2px rgba(22, 32, 45, 0.04), 0 18px 48px -12px rgba(22, 32, 45, 0.16);
    padding: 40px 40px 36px;
    overflow: hidden;
}

/* A thin gold rule across the top of the card */
.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c49f2c, var(--gold), #dcbc4f);
}

.auth-title {
    margin: 0 0 26px;
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ink);
}


/* ---- Fields ---- */

.auth-page .form-label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--ink-2);
}

.auth-page .form-control,
.auth-page .form-select {
    height: 48px;
    padding: 0 14px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--ink);
    background-color: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-control);
    box-shadow: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.auth-page .form-select {
    padding-right: 40px;
}

.auth-page .form-control::placeholder {
    color: var(--ink-4);
}

.auth-page .form-control:focus,
.auth-page .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18);
    outline: none;
}

.auth-page .form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--ink-3);
}

.auth-page .form-check-input:checked {
    background-color: var(--gold-ink);
    border-color: var(--gold-ink);
}

.auth-page .form-check-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18);
}

.auth-page .form-check-label {
    font-size: 14px;
    color: var(--ink-2);
}

/* Password field with a show/hide eye inside its right edge */
.auth-password {
    position: relative;
}

.auth-page .auth-password .form-control {
    padding-right: 48px;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-3);
    font-size: 18px;
    transform: translateY(-50%);
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: var(--gold-ink);
    background: var(--cream);
    outline: none;
}

.auth-field-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ---- Links ---- */

.auth-page a {
    color: var(--gold-ink);
    text-decoration: none;
    transition: color 0.2s;
}

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

.auth-link-quiet {
    font-size: 13px;
    color: var(--ink-3) !important;
}

.auth-link-quiet:hover {
    color: var(--gold-ink) !important;
}

/* ---- Buttons (the homepage's btn-brand, in form shape) ---- */

.auth-actions {
    display: flex;
    gap: 10px;
    margin-top: 28px;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    padding: 0 24px;
    border-radius: var(--radius-control);
    border: 1px solid transparent;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
                border-color 0.25s var(--ease), transform 0.25s var(--ease),
                box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
}

.auth-btn-gold {
    flex: 1;
    background: linear-gradient(180deg, #dcbc4f 0%, var(--gold) 55%, #c49f2c 100%);
    color: var(--ink);
    box-shadow: 0 8px 24px -8px rgba(212, 175, 55, 0.55);
}

.auth-btn-gold:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 12px 28px -8px rgba(212, 175, 55, 0.65);
}

.auth-btn-gold:focus-visible,
.auth-btn-ghost:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.3);
}

.auth-btn-gold:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

.auth-btn-ghost {
    background: transparent;
    color: var(--ink-2);
    border-color: var(--line-strong);
}

.auth-btn-ghost:hover {
    color: var(--ink);
    border-color: var(--ink-3);
    background: var(--cream);
}

/* ---- Organization step ---- */

.auth-welcome {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
}

.auth-welcome-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--gold-line);
    background: #fff;
    color: var(--gold-ink);
    font-size: 20px;
}

.auth-welcome-name {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
}

.auth-welcome p {
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--ink-3);
}

.auth-reset {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--line-strong);
    text-align: center;
    font-size: 14px;
    color: var(--ink-3);
}

/* A notice inside the card: a cream well with a gold edge */
.auth-note {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding: 12px 14px;
    background: var(--cream);
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-control);
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-2);
}

.auth-note i {
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 16px;
    color: var(--gold-ink);
}

.auth-note strong {
    color: var(--ink);
}

/* ---- Below the card ---- */

/* Secondary destinations: small, quiet, dot-separated */
.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.auth-links a {
    color: var(--ink-3);
}

.auth-links a:hover {
    color: var(--gold-ink);
}

.auth-switch {
    margin: 22px 0 0;
    text-align: center;
    font-size: 15px;
    color: var(--ink-3);
}

.auth-switch a {
    font-weight: 600;
    border-bottom: 1px solid rgba(138, 109, 18, 0.35);
}

.auth-switch a:hover {
    border-color: var(--ink);
}

/* ===========================================
   MOTION
   =========================================== */

/* The card rises in on load and whenever login and register swap */
.auth-card:not(.d-none) {
    animation: authCardIn 0.55s var(--ease) both;
}

/* The organization step slides in beside the credentials it replaces */
.auth-step:not(.d-none) {
    animation: authStepIn 0.35s var(--ease) both;
}

.auth-hero-copy {
    animation: authHeroIn 0.8s var(--ease) 0.1s both;
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

@keyframes authStepIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: none; }
}

@keyframes authHeroIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card:not(.d-none),
    .auth-step:not(.d-none),
    .auth-hero-copy {
        animation: none;
    }
    .auth-btn,
    .auth-page .form-control,
    .auth-page .form-select {
        transition: none;
    }
}

/* ===========================================
   RESPONSIVE: the hero becomes a band on top
   =========================================== */

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

    .auth-hero {
        gap: 28px;
        padding: 28px 24px 36px;
    }

    .auth-hero::after {
        top: auto;
        left: 0;
        width: auto;
        height: 1px;
        background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
    }

    .auth-hero h1 {
        font-size: clamp(28px, 7vw, 38px);
    }

    .auth-lead,
    .auth-hero-foot {
        display: none;
    }

    .auth-main {
        align-items: flex-start;
        padding: 32px 16px 48px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 32px 22px 28px;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-eyebrow {
        margin-bottom: 14px;
    }
}
