/* =====================================================================
   HireXA Candidate portal - sign in / sign up / verify / reset
   Same frame as hirexa.ai/login: full-bleed photo hero with a dark
   gradient, a 624px frosted-glass card holding a 544px column, Inter,
   white type, glossy blue CTA. Numbers are the /login route's own
   (landing.css "is-login-route" tier), so the two cards read as one
   product. Mobile: the card fills the width, the page scrolls.
   ===================================================================== */

:root {
    /* Darker than the main app's glass (its photo is dim; ours is a white
       office), with a soft edge, so the card reads as its own panel instead
       of merging with the wall behind it. */
    --glass-bg: rgba(14, 20, 28, 0.40);
    --glass-glow: inset 0 0 37.2px 2px rgba(255, 255, 255, 0.30), 0 24px 60px rgba(0, 0, 0, 0.22);
    --field-bg: rgba(255, 255, 255, 0.08);
    --field-bg-focus: rgba(255, 255, 255, 0.14);
    --ring: rgba(138, 201, 255, 0.25);
    --ring-border: rgba(138, 201, 255, 0.55);
    --text: #FCFCFC;
    --text-dim: #D6DAE0;
    --text-faint: #B8BEC8;
    --text-quiet: #7E8899;
    --blue: #0B90F3;
    --blue-edge: #8AC9FF;
    --app-vh: 100vh;
    --app-zoom: 1;
}
/* Same auto-fit zoom as the main app's login: the inline <head> script sets
   --app-zoom (width / 1920 between 1024 and 1920) and a zoom-compensated
   --app-vh; with JS off this is plain 1.0 / 100vh. */
html { zoom: var(--app-zoom, 1); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #FFFFFF;
    background: #1c2530;
}
button, input, textarea, select { font-family: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: var(--app-vh);
    display: flex;
    align-items: center;
    padding: 24px 0 24px 80px;
    /* The photo is a bright white office, so the left side (where the card
       sits) carries a stronger darkening than the main app's darker photo
       needed; without it the white type on the glass disappears. Anchored
       left so the group on the right is never cropped under the card. */
    background-image:
        linear-gradient(90deg, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.38) 40%, rgba(0, 0, 0, 0.10) 65%, rgba(0, 0, 0, 0) 80%),
        url("/static/assets/login-hero.jpg");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: cover;
    background-color: #1c2530;
}

/* ---------- Glass card ---------- */
.card {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* NOT justify-content:center. When the stack is taller than the card
       (sign-up on a 768px laptop) centring pushes it out of BOTH ends and the
       brand row is clipped. Auto margins on the panel centre it when there
       is spare room and collapse to 0 once it overflows, so it scrolls from
       the top instead. */
    justify-content: flex-start;
    /* A step narrower than the main app's 624: on the office photo the wide
       card read as a slab. Same 40px gutters, so the column is 480. */
    width: 560px;
    max-width: calc(100vw - 40px);
    /* No max-height and no inner scroll: the card is always its content's
       height. On the rare screen too short for a panel (sign-up on a small
       laptop) the hero grows and the PAGE scrolls, never the card. */
    padding: 24px 40px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: var(--glass-bg);
    box-shadow: var(--glass-glow);
    -webkit-backdrop-filter: blur(28px) saturate(125%);
    backdrop-filter: blur(28px) saturate(125%);
    transform: translateZ(0);
}

/* One panel at a time; each is the flush 544px column. */
.panel {
    display: none;
    flex-direction: column;
    width: 480px;
    max-width: 100%;
    gap: 20px;
}
/* No entry animation: a fade-in from opacity 0 left the card blank in the
   very first painted frame, which is exactly the frame a screenshot or a
   slow device shows. */
.panel.active { display: flex; margin: auto 0; }
.panel > * { flex-shrink: 0; }

/* Back arrow, top-left of the card (the OTP / reset steps) */
.back {
    position: absolute;
    top: 18px; left: 18px;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: 8px;
    color: #E7EAF0; cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.back:hover { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }
.back svg { width: 20px; height: 20px; }

/* ---------- Head: brand + headings ---------- */
.head { display: flex; flex-direction: column; align-items: center; gap: 16px; align-self: stretch; }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; display: inline-flex; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-name { font-weight: 600; font-size: 24px; letter-spacing: -0.01em; color: #FFFFFF; }
.headings { display: flex; flex-direction: column; align-items: center; gap: 8px; align-self: stretch; }
.title { font-weight: 600; font-size: 37px; line-height: 46px; text-align: center; color: #FAFAFA; }
.subtitle { max-width: 420px; font-weight: 400; font-size: 13px; line-height: 22px; text-align: center; color: var(--text-dim); }
.subtitle strong { color: #FFFFFF; font-weight: 600; }

/* ---------- Google button ---------- */
.social-row { display: flex; gap: 16px; align-self: stretch; }
.social {
    flex: 1 1 0;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    height: 44px; padding: 0 16px;
    background: var(--field-bg); border: 0; border-radius: 12px;
    color: var(--text); cursor: pointer; white-space: nowrap;
    transition: background 0.15s ease, transform 0.12s ease;
}
.social:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
.social:disabled { opacity: 0.6; cursor: wait; transform: none; }
.social-icon { flex-shrink: 0; width: 24px; height: 24px; border-radius: 3px; }
.social span { font-weight: 600; font-size: 13px; line-height: 22px; color: var(--text); }

/* ---------- OR divider ---------- */
.divider { display: flex; align-items: center; gap: 12px; align-self: stretch; color: var(--text-faint); font-size: 12px; line-height: 20px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.2); }

/* ---------- Form ---------- */
.form { display: flex; flex-direction: column; gap: 20px; align-self: stretch; }
.fields { display: flex; flex-direction: column; gap: 20px; align-self: stretch; }
.field { display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
.label { font-weight: 600; font-size: 13px; line-height: 22px; color: var(--text); }
.label .opt { font-weight: 400; color: var(--text-faint); margin-left: 4px; }
.input {
    width: 100%; height: 42px; padding: 12px 16px;
    background: var(--field-bg); border: 1px solid transparent; border-radius: 12px;
    font-weight: 400; font-size: 13px; line-height: 22px; color: var(--text);
    outline: none; appearance: none;
    transition: box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { background: var(--field-bg-focus); border-color: var(--ring-border); box-shadow: 0 0 0 3px var(--ring); }
.input.has-error { border-color: rgba(255, 120, 120, 0.7); }
/* Chrome autofill paints inputs light, hiding the white text. */
.input:-webkit-autofill, .input:-webkit-autofill:hover, .input:-webkit-autofill:focus {
    -webkit-text-fill-color: #FFFFFF;
    -webkit-box-shadow: 0 0 0 1000px rgba(24, 30, 40, 0.92) inset;
    caret-color: #FFFFFF;
    transition: background-color 9999s ease-out 0s;
}
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.eye {
    position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
    width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; padding: 0; cursor: pointer; color: #F8FAFC;
}
.eye svg { width: 16px; height: 16px; display: block; }
.hint { font-size: 11px; line-height: 16px; color: var(--text-faint); }

/* Remember / forgot */
.options { display: flex; align-items: center; justify-content: space-between; align-self: stretch; min-height: 20px; }
.remember { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 400; font-size: 11px; line-height: 20px; color: var(--text-quiet); }
.remember input { display: none; }
.check { width: 14px; height: 14px; border: 1.5px solid #94A3B8; border-radius: 3px; position: relative; flex-shrink: 0; transition: background 0.15s, border-color 0.15s; }
.remember input:checked + .check { background: var(--blue); border-color: var(--blue); }
.remember input:checked + .check::after { content: ""; position: absolute; left: 4px; top: 1px; width: 3.5px; height: 7px; border: solid #FFFFFF; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.forgot { font-weight: 400; font-size: 11px; line-height: 20px; color: #ECEFF3; text-decoration: none; }
.forgot:hover, .forgot:focus-visible { color: #FFFFFF; text-decoration: underline; }

/* Status pill (errors / progress) */
.alert {
    display: none; margin: 0; padding: 10px 14px; border-radius: 12px;
    font-size: 13px; font-weight: 500; line-height: 18px; text-align: center; color: #EAF2FF;
    background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.18);
}
.alert.show { display: block; }
.alert.info { background: rgba(11, 144, 243, 0.20); border-color: rgba(138, 201, 255, 0.42); color: #DCEBFF; }
.alert.success { background: rgba(52, 199, 89, 0.20); border-color: rgba(52, 199, 89, 0.42); color: #CFF7DA; }
.alert.error { background: rgba(239, 68, 68, 0.20); border-color: rgba(239, 68, 68, 0.45); color: #FFD9D9; }

/* Primary submit: glossy blue with the white inner glow */
.submit {
    display: flex; justify-content: center; align-items: center; gap: 8px;
    align-self: stretch; width: 100%; height: 42px; padding: 0 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 55%), var(--blue);
    border: 1px solid var(--blue-edge); border-radius: 15px;
    box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.1), inset 0 0 7.7px #FFFFFF, inset 0 0 6.2px #FFFFFF;
    font-weight: 600; font-size: 13px; line-height: 17px; color: #FFFFFF; cursor: pointer;
    transition: filter 0.15s ease, transform 0.12s ease;
}
.submit:hover { filter: brightness(1.05); transform: translateY(-1px); }
.submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; filter: none; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- OTP ---------- */
.otp-sub { text-align: center; font-size: 13px; line-height: 22px; color: var(--text-dim); }
.otp-sub strong { color: #FFFFFF; font-weight: 600; word-break: break-all; }
.otp-group { display: flex; justify-content: center; gap: 10px; align-self: stretch; }
.otp {
    width: 52px; height: 56px; text-align: center;
    font-size: 22px; font-weight: 600; color: #FFFFFF;
    background: var(--field-bg); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 12px;
    outline: 0; caret-color: #FFFFFF;
    transition: box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.otp:focus { background: var(--field-bg-focus); border-color: rgba(138, 201, 255, 0.7); box-shadow: 0 0 0 3px var(--ring); }
.otp.filled { border-color: rgba(255, 255, 255, 0.35); }
.resend { text-align: center; font-size: 13px; line-height: 20px; color: var(--text-dim); }
.resend a { color: #6FB8FF; font-weight: 600; text-decoration: none; margin-left: 6px; cursor: pointer; }
.resend a:hover { text-decoration: underline; }
.resend a.cooldown { color: #BEE0FF; background: rgba(138, 201, 255, 0.18); border-radius: 999px; padding: 2px 10px; text-decoration: none; cursor: default; }
.change-email { text-align: center; font-size: 12px; line-height: 18px; color: var(--text-faint); }
.change-email a { color: var(--text-dim); text-decoration: underline; cursor: pointer; }

/* ---------- Foot ---------- */
.foot-divider { align-self: stretch; width: 100%; height: 0; margin: 0; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.foot { display: flex; flex-direction: column; align-items: center; gap: 12px; align-self: stretch; }
.swap { display: flex; justify-content: center; align-items: flex-start; gap: 6px; margin: 0; font-weight: 600; font-size: 13px; line-height: 20px; color: var(--text); }
.swap a { text-decoration: underline; color: var(--text); cursor: pointer; }
.legal { display: flex; justify-content: center; align-items: center; gap: 8px; align-self: stretch; flex-wrap: wrap; }
.legal a { font-weight: 500; font-size: 12px; line-height: 13px; color: var(--text-dim); text-decoration: none; }
.legal a:hover { color: #FFFFFF; text-decoration: underline; }
.legal span { font-weight: 400; font-size: 12px; line-height: 13px; color: var(--text-dim); }
.legal-note { text-align: center; font-size: 11px; line-height: 16px; color: var(--text-faint); }
.legal-note a { color: var(--text-dim); }

/* ---------- Signed-in page ---------- */
.me-row { display: flex; align-items: center; gap: 14px; align-self: stretch; padding: 14px 16px; background: var(--field-bg); border-radius: 12px; }
.me-avatar { width: 44px; height: 44px; border-radius: 50%; background: rgba(11,144,243,0.35); display: grid; place-items: center; font-weight: 600; font-size: 16px; overflow: hidden; flex-shrink: 0; }
.me-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-name { font-weight: 600; font-size: 15px; line-height: 20px; }
.me-email { font-size: 12px; line-height: 18px; color: var(--text-dim); }
.me-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-self: stretch; font-size: 13px; line-height: 20px; }
.me-facts dt { color: var(--text-faint); }
.me-facts dd { color: var(--text); }
.ghost {
    display: flex; justify-content: center; align-items: center; align-self: stretch; height: 42px;
    background: var(--field-bg); border: 1px solid rgba(255,255,255,0.14); border-radius: 12px;
    color: var(--text); font-weight: 600; font-size: 13px; text-decoration: none; cursor: pointer;
}
.ghost:hover { background: rgba(255, 255, 255, 0.16); }

/* ---------- Responsive ---------- */
/* Short viewports (laptops): tighten the vertical rhythm, keep every width. */
@media (max-height: 920px) {
    .card { padding: 18px 40px; }
    .panel { gap: 16px; }
    .title { font-size: 32px; line-height: 40px; }
    .head { gap: 12px; }
    .form, .fields { gap: 16px; }
}
/* Tablet and down: no side-anchored layout, the card sits centred on the photo. */
@media (max-width: 1180px) {
    .hero {
        padding: 24px;
        justify-content: center;
        background-image:
            linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.55)),
            url("/static/assets/login-hero.jpg");
        background-position: center;
    }
}
/* Phones: the card takes the width and sits centred in the viewport. When a
   panel is taller than the screen (sign-up on a small phone) the hero grows
   with it and the PAGE scrolls, not the card, so the keyboard never traps a
   field out of view. */
@media (max-width: 640px) {
    .hero {
        padding: 16px 14px; align-items: center; justify-content: center;
        /* Own portrait photo for phones (frontend/assets/login-hero-mobile.jpg):
           the group sits in the bottom third, so it shows beneath the card
           and the calm wall above it carries the glass. */
        background-image:
            linear-gradient(180deg, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0.48) 60%, rgba(0,0,0,0.30) 100%),
            url("/static/assets/login-hero-mobile.jpg");
        background-position: center top;
    }
    .card { margin: auto; max-width: 100%; padding: 22px 18px 20px; }
    .panel { gap: 16px; }
    .title { font-size: 28px; line-height: 36px; }
    .subtitle { font-size: 13px; }
    .social-row { flex-direction: column; gap: 10px; }
    .input, .submit, .social { height: 44px; }
    .input { font-size: 16px; } /* iOS zooms on anything smaller when focused */
    .otp-group { gap: 8px; }
    .otp { width: 44px; height: 50px; font-size: 20px; }
    .back { top: 14px; left: 12px; }
    .options { flex-wrap: wrap; gap: 6px; }
}
@media (max-width: 360px) {
    .otp-group { gap: 6px; }
    .otp { width: 40px; height: 46px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .social:hover, .submit:hover { transform: none; }
}
