/* ============================================================================
   Anirup Interiors — auth surfaces (login / forgot / reset / company select).
   Cinematic dark brand showcase (left) + warm ivory, content-filled form side
   (right). Tokens from app.css. The split fills the screen — no dead space.
   ========================================================================== */
.auth-body { margin: 0; background: var(--ivory); color: var(--text); }

/* ---------- Customer-facing quotation pages (_PublicDocLayout) ----------
   Opened from an email or a WhatsApp message, most often on a phone, by someone who has never seen this
   application. Plain and legible rather than branded chrome. */
.pubdoc-body { margin: 0; background: var(--ivory); color: var(--text); }
.pubdoc-main { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.pubdoc-notice { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.pubdoc-notice-card {
    max-width: 30rem; text-align: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: 1rem;
    padding: 2.5rem 1.75rem; box-shadow: var(--shadow-md);
}
.pubdoc-notice-icon { font-size: 2.5rem; color: var(--muted); display: block; margin-bottom: .75rem; }
.pubdoc-notice-title { font-size: 1.35rem; font-weight: 600; margin: 0 0 .6rem; }
.pubdoc-notice-text { color: var(--muted); margin: 0; line-height: 1.6; }

/* ---------- Signing page ---------- */
.pubdoc-head { padding: .9rem 1rem; }
.pubdoc-head-inner { max-width: 76rem; margin: 0 auto; display: flex; align-items: center; gap: .85rem; }
/* On a white chip, not straight onto the band. The band is the company's own colour and most logos are
   drawn for white paper — this one is red on transparent, so it would vanish on a red band. The printed
   document solves it with a white wedge in the masthead; this is the same idea at header size, and it
   works whatever colour a company picks. */
.pubdoc-logo {
    height: 34px; width: auto; display: block;
    background: #fff; border-radius: 7px; padding: 5px 9px; box-sizing: content-box;
}
.pubdoc-head-company { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.pubdoc-head-sub { font-size: .85rem; opacity: .85; }

.pubdoc-wrap { max-width: 76rem; margin: 0 auto; padding: 1rem; width: 100%; }

/* The document is a fixed 850px design; quote-doc-fit.js scales it to the container. The scroll layer
   is what "actual size" pans, and .pubdoc-fitwrap sits between it and the document because that script
   writes height/overflow onto the document's PARENT — without the extra layer it would set
   overflow:hidden on the scroller and kill panning. */
.pubdoc-frame { position: relative; margin-bottom: 1rem; }
/* A row above the document, not an overlay on it. Absolutely positioned at top-right it sat exactly on
   the masthead's white logo wedge. */
.pubdoc-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    margin-bottom: .5rem; flex-wrap: wrap;
}
.pubdoc-toolbar-label { font-weight: 600; color: var(--muted); font-size: .9rem; }
.pubdoc-scroll {
    overflow: auto; -webkit-overflow-scrolling: touch;
    background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: .5rem;
}
.pubdoc-frame[data-mode="full"] .pubdoc-scroll { max-height: 75vh; }

.pubdoc-panel {
    background: var(--surface); border: 1px solid var(--line); border-radius: .9rem;
    padding: 1.25rem; box-shadow: var(--shadow-sm);
}
.pubdoc-panel-title { margin: 0 0 .5rem; font-weight: 600; letter-spacing: -.01em; }

/* Three screens is enough to feel open-ended without something saying how far along you are. */
.pubdoc-steps {
    list-style: none; display: flex; align-items: center; gap: .35rem;
    margin: -.15rem 0 1rem; padding: 0 0 .9rem; border-bottom: 1px solid var(--line);
}
.pubdoc-steps li { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .78rem; }
/* The connector between steps — on the item, so the first one has none. */
.pubdoc-steps li + li::before { content: ""; width: .9rem; height: 1px; background: var(--line); margin-right: .1rem; }
.pubdoc-step-dot {
    width: 1.35rem; height: 1.35rem; border-radius: 50%; flex: 0 0 auto;
    display: grid; place-items: center; font-size: .7rem; font-weight: 700; line-height: 1;
    background: var(--sand); color: var(--muted); border: 1px solid var(--line);
}
.pubdoc-steps .is-now { color: var(--text); font-weight: 600; }
.pubdoc-steps .is-now .pubdoc-step-dot {
    background: var(--anirup-red, #E8161F); border-color: var(--anirup-red, #E8161F); color: #fff;
}
.pubdoc-steps .is-done .pubdoc-step-dot {
    background: var(--anirup-red-soft); border-color: var(--anirup-red-line); color: var(--anirup-red, #E8161F);
}

/* Confirms the OTP actually did something — otherwise the code step just vanishes. */
.pubdoc-verified { color: var(--muted); margin-top: -.25rem; }
.pubdoc-verified .bi { color: #1a7f4b; }

/* A signature is drawn, not typed — give it real room and a baseline to aim at. The guide and the prompt
   are layered UNDER a transparent canvas rather than painted into it, so clearing never repaints them and
   they can never leak into the exported PNG. */
.pubdoc-pad-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.pubdoc-pad-wrap {
    position: relative; overflow: hidden; background: #fff;
    border: 1px solid var(--line); border-radius: .6rem;
    box-shadow: inset 0 1px 2px rgba(17, 17, 17, .045);
}
.pubdoc-pad {
    position: relative; z-index: 2;
    width: 100%; height: 180px; display: block; touch-action: none; cursor: crosshair;
    background: transparent;
}
.pubdoc-pad-guide {
    position: absolute; z-index: 1; left: 1rem; right: 1rem; bottom: 3.1rem;
    display: flex; align-items: center; gap: .5rem; pointer-events: none;
}
.pubdoc-pad-x { color: var(--muted); font-size: .9rem; line-height: 1; }
.pubdoc-pad-rule { flex: 1; height: 1px; background: var(--line); }
.pubdoc-pad-hint {
    position: absolute; z-index: 1; left: 0; right: 0; bottom: 1.1rem;
    text-align: center; color: var(--muted); font-size: .8rem; pointer-events: none;
    transition: opacity .15s ease;
}
.pubdoc-pad-wrap.is-signed .pubdoc-pad-guide, .pubdoc-pad-wrap.is-signed .pubdoc-pad-hint { opacity: 0; }

.pubdoc-code { letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }

/* The statement is long and legal-ish; boxing it stops it reading as body copy. */
.pubdoc-consent { background: var(--sand); border-radius: .55rem; padding: .7rem .7rem .7rem 2.1rem; }

/* Required marker. aria-hidden on the glyph in the markup, so a screen reader hears the field name once
   rather than "star". */
.pubdoc-req { color: var(--anirup-red, #E8161F); font-weight: 700; }

/* The dial code keeps its natural width beside the number rather than splitting the row in half. */
.pubdoc-dialcode { flex: 0 0 auto; width: auto; min-width: 6.5rem; }

/* Declining is a real choice but not the one this panel is for — a quiet line, not a second button
   competing with the primary. */
.pubdoc-decline-line { text-align: center; color: var(--muted); font-size: .85rem; margin: .85rem 0 0; }
.pubdoc-decline-line .btn-link { font-size: .85rem; font-weight: 600; text-decoration: underline; }

/* Reasons read as one list of taps, so the whole row is the target, not just the radio. */
.pubdoc-reasons { display: grid; gap: .4rem; }
.pubdoc-reason {
    margin: 0; padding: .6rem .75rem .6rem 2.15rem;
    border: 1px solid var(--line); border-radius: .55rem; cursor: pointer;
    transition: border-color .12s ease, background-color .12s ease;
}
.pubdoc-reason .form-check-input { margin-left: -1.4rem; margin-top: .18rem; cursor: pointer; }
.pubdoc-reason .form-check-label { cursor: pointer; display: block; }
.pubdoc-reason:hover { background: var(--sand); }
.pubdoc-reason:has(.form-check-input:checked) { border-color: var(--anirup-red, #E8161F); background: var(--anirup-red-soft); }

/* Always-available, never competing with whatever the primary action is. */
.pubdoc-quiet {
    display: flex; align-items: center; justify-content: center; gap: .45rem;
    margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line);
    color: var(--muted); font-size: .875rem; text-decoration: none;
}
.pubdoc-quiet:hover { color: var(--anirup-red, #E8161F); }
.pubdoc-quiet span { text-decoration: underline; }

.pubdoc-foot { color: var(--muted); font-size: .8rem; text-align: center; padding: 1.25rem 0 2rem; line-height: 1.7; }

@media (min-width: 992px) {
    /* Document and panel side by side, with the panel following the reader down a long quotation. */
    .pubdoc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.25rem; align-items: start; }
    .pubdoc-wrap > .alert, .pubdoc-wrap > p { grid-column: 1 / -1; }
    .pubdoc-frame { grid-column: 1; margin-bottom: 0; }
    .pubdoc-panel { grid-column: 2; position: sticky; top: 1rem; }
    .pubdoc-foot { grid-column: 1 / -1; }
}

@media (max-width: 991.98px) {
    /* Touch targets stay comfortable on a phone, matching the app's own mobile rules. */
    .pubdoc-panel .btn { min-height: 44px; }
}

.auth-split { display: grid; grid-template-columns: 1.08fr 1fr; min-height: 100vh; min-height: 100dvh; }

/* ---------- Left: dark brand showcase ---------- */
.auth-brand {
    position: relative; overflow: hidden;
    background: var(--grad-ink);
    color: #EDEDEF;
    display: flex; align-items: center;
    padding: clamp(2.5rem, 4.6vw, 5rem);
    isolation: isolate;
}
.auth-brand-ember {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(72% 60% at 14% 8%, rgba(232, 22, 31, .26), transparent 62%);
}
.auth-brand-glow {
    position: absolute; z-index: 0; pointer-events: none;
    width: 60vh; height: 60vh; right: -16vh; bottom: -20vh; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(232, 22, 31, .2), transparent 72%);
    filter: blur(8px);
}
.auth-brand.grain::after { z-index: 1; }
.auth-brand-inner { position: relative; z-index: 2; max-width: 510px; width: 100%; }
.auth-logo { display: block; width: fit-content; margin-bottom: clamp(1.8rem, 4vh, 3rem); text-decoration: none; }
.auth-brand .brand-word, .auth-brand .brand-sub, .auth-brand .brand-fallback { color: #fff; }

.auth-eyebrow { color: rgba(255, 255, 255, .64); margin-bottom: 1.05rem; }
.auth-tagline { display: none; } /* shown only on mobile, where the headline is hidden */
.auth-headline {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(2.5rem, 3.8vw, 3.7rem); line-height: 1.02;
    letter-spacing: -.025em; color: #fff; margin: 0 0 1.05rem;
    font-optical-sizing: auto;
}
.auth-sub { color: rgba(255, 255, 255, .72); font-size: 1.12rem; line-height: 1.58; margin-bottom: 1.9rem; max-width: 30rem; }

.auth-points { list-style: none; padding: 0; margin: 0 0 1.8rem; display: grid; gap: .8rem; }
.auth-points li { display: flex; align-items: center; gap: .75rem; color: rgba(255, 255, 255, .84); font-size: 1.04rem; }
.ap-ico {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
    display: grid; place-items: center; background: var(--anirup-red-soft);
    color: #ff5159; font-size: .9rem;
    box-shadow: inset 0 0 0 1px var(--anirup-red-line);
}

/* Brand-side stat strip — fills the lower band, reinforces scale. */
.auth-stats {
    display: flex; align-items: center; gap: 1.5rem;
    padding: 1.4rem 0; margin-bottom: .4rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.as { display: flex; flex-direction: column; gap: .12rem; }
.as-k { font-family: var(--font-display); font-weight: 600; font-size: 1.42rem; line-height: 1; color: #fff; letter-spacing: -.01em; }
.as-l { font-family: var(--font-label); text-transform: uppercase; letter-spacing: .14em; font-size: .64rem; color: rgba(255, 255, 255, .46); }
.as-div { width: 1px; height: 30px; background: rgba(255, 255, 255, .12); }

.auth-clients { padding-top: 1.5rem; }
.auth-clients .hc-label {
    display: block; font-family: var(--font-label); text-transform: uppercase;
    letter-spacing: .16em; font-size: .66rem; color: rgba(255, 255, 255, .4); margin-bottom: .35rem;
}
.auth-clients-names { color: rgba(255, 255, 255, .74); font-size: 1.02rem; letter-spacing: .01em; }

/* ---------- Right: warm ivory form side ---------- */
.auth-form-side {
    position: relative; overflow: hidden;
    background:
        radial-gradient(120% 78% at 100% 0%, var(--sand), transparent 56%),
        radial-gradient(90% 60% at 0% 100%, var(--bone), transparent 60%),
        var(--ivory);
    display: flex; align-items: safe center; justify-content: center;
    padding: clamp(2rem, 4vw, 3.5rem);
}
.auth-watermark {
    position: absolute; z-index: 0; pointer-events: none;
    width: 56vh; height: 56vh; right: -11vh; bottom: -13vh;
    color: var(--bone); opacity: .65;
}
.auth-form-col {
    position: relative; z-index: 1; width: 100%; max-width: 468px;
    display: flex; flex-direction: column; gap: 1.5rem;
}

.auth-card {
    position: relative;
    width: 100%; background: var(--surface);
    border: 1px solid var(--line-warm); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: clamp(1.6rem, 1rem + 2vw, 2.9rem) clamp(1.6rem, 1rem + 2vw, 2.9rem) clamp(1.5rem, 1rem + 1.6vw, 2.6rem);
    overflow: hidden;
}
.auth-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
    background: linear-gradient(90deg, var(--anirup-red), var(--anirup-red-hover) 58%, var(--champagne));
}
.auth-card h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.15rem); letter-spacing: -.02em; margin-bottom: .35rem; }
.auth-card .auth-lead { color: var(--muted); font-size: clamp(1rem, .95rem + .3vw, 1.1rem); margin-bottom: 1.9rem; }

/* Fields — clear top labels (a11y) + leading icon + optional password toggle. */
.auth-card .form-label { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.field-control { position: relative; }
.field-ico {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: 1.05rem; pointer-events: none;
}
.auth-card .form-control {
    padding: .85rem 1rem .85rem 2.7rem; font-size: clamp(1rem, .96rem + .25vw, 1.08rem); min-height: clamp(48px, 44px + 1vh, 54px);
    border-color: var(--line-warm); background: #fff; border-radius: 12px;
}
.auth-card .form-control:focus { border-color: var(--anirup-red); box-shadow: 0 0 0 .22rem var(--bs-focus-ring-color); }
.field-control.has-toggle .form-control { padding-right: 3.1rem; }
.field-toggle {
    position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted);
    border-radius: 9px; display: grid; place-items: center; cursor: pointer;
}
.field-toggle:hover { color: var(--anirup-red); background: var(--anirup-red-soft); }

.auth-card .btn { font-size: clamp(1.04rem, 1rem + .3vw, 1.12rem); padding: .85rem 1rem; }
.auth-card .btn-anirup, .auth-card .btn-brass { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.auth-card .form-check-label, .auth-card a.small, .auth-card .small { font-size: .98rem; }
.auth-card a { font-weight: 500; }

/* Assurance row under the card — fills the otherwise-empty space, builds trust. */
.auth-assure { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; }
.aa {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .86rem; color: var(--muted);
    padding: .42rem .8rem; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line-warm);
}
.aa .bi { color: var(--anirup-red); font-size: .95rem; }

/* Trust band at the bottom of the column. */
.auth-trust {
    display: flex; align-items: center; justify-content: center; gap: .7rem;
    color: var(--muted); font-size: .92rem; flex-wrap: wrap;
}
.auth-trust .at-item { display: inline-flex; align-items: center; gap: .4rem; }
.auth-trust .bi-shield-check { color: var(--anirup-red); }
.auth-trust .at-sep { opacity: .5; }

/* Card entrance (disabled under reduced motion below) */
@media (prefers-reduced-motion: no-preference) {
    .auth-card { animation: authCardUp .5s ease both; }
}
@keyframes authCardUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Company / branch selectors ---------- */
.auth-company-list { display: grid; gap: .6rem; }
.auth-company-option {
    width: 100%; text-align: left; display: flex; align-items: center; gap: 1rem;
    padding: 1.1rem 1.15rem; border: 1px solid var(--line-warm); border-radius: 14px;
    background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.08rem;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
    min-height: 56px;
}
.auth-company-option:hover { border-color: var(--anirup-red); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.auth-company-option .ico { width: 46px; height: 46px; border-radius: 12px; flex: 0 0 46px; display: grid; place-items: center; background: var(--anirup-red-soft); color: var(--anirup-red); font-size: 1.25rem; }
.auth-company-option .meta small { color: var(--muted); }

.auth-company-group { border: 1px solid var(--line-warm); border-radius: 16px; overflow: hidden; margin-bottom: .9rem; }
.auth-company-group-head { display: flex; align-items: center; gap: .7rem; padding: .85rem 1.1rem; background: var(--sand); font-weight: 600; }
.auth-company-group-head i { color: var(--anirup-red); }
.auth-company-group .auth-company-option { border: 0; border-top: 1px solid var(--line-warm); border-radius: 0; transform: none; }
.auth-company-group .auth-company-option:hover { background: var(--sand); box-shadow: none; }

/* ---------- Mobile: single column, brand becomes a compact centred header ---------- */
@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; min-height: 100vh; min-height: 100dvh; }
    .auth-brand { align-items: center; justify-content: center; text-align: center; padding: 1.9rem 1.4rem; }
    .auth-brand-inner { max-width: none; width: 100%; }
    .auth-logo { margin-bottom: .5rem; }
    .auth-eyebrow, .auth-headline, .auth-sub, .auth-points, .auth-stats, .auth-clients { display: none; }
    .auth-tagline { display: block; color: rgba(255, 255, 255, .74); font-size: 1rem; margin: 0; }
    /* Top-align so long content (the workspace chooser) never gets clipped. */
    .auth-form-side { padding: 1.6rem 1.1rem 2.5rem; align-items: flex-start; }
    .auth-watermark { display: none; }
    .auth-card { padding: 1.8rem 1.5rem; border-radius: 18px; box-shadow: var(--shadow-md); }
}

/* Short viewports (≈≤720px tall laptops / landscape phones) — compress the column
   so the sign-in card fits one screen; taller content still scrolls (safe center). */
@media (max-height: 720px) {
    .auth-form-col { gap: 1rem; }
    .auth-card { padding: clamp(1.4rem, 3vh, 2rem) clamp(1.6rem, 4vw, 2.4rem); }
    .auth-card .auth-lead { margin-bottom: 1.1rem; }
    .auth-brand { padding: clamp(1.8rem, 5vh, 3.2rem) clamp(2.5rem, 4.6vw, 5rem); }
    .auth-form-side { padding: clamp(1.4rem, 4vh, 2.5rem) clamp(2rem, 4vw, 3.5rem); }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
