/* ============================================================
   LabelInn — auth ACTION surfaces on the V3 paper / ink / signal
   system: auth-action.html (reset / verify / recover) and
   verify-email.html.

   WHY THIS FILE EXISTS
   --------------------
   login.html and register.html were migrated to the V3 system
   (css/auth-v3.css). These two pages were left behind on
   main.css + components.css — the OLD palette: #2563eb gradient
   circles, 1rem radii, drop shadows, a marketing navbar. So the
   button in a V3-branded email dropped the user onto a page that
   looked like a different, older product, at the exact moment
   (password reset) where looking unfamiliar reads as phishing.

   CONTRACT
   --------
   • Loaded AFTER css/auth-v3.css, which owns the tokens, the
     paper ground and the generic .form-group / message rules.
     Everything here is the page-specific layer on top.
   • Purely visual. Every id, class and DOM shape these pages
     ship stays exactly as the behaviour scripts expect them —
     .view/.view.active toggling, .requirement.met, the inline
     display:none on the message rows.
   • Square corners, hard 1px ink hairlines, hard offset shadows,
     mono uppercase micro-labels. No radii, no blurred shadows,
     no gradients. Same vocabulary as emails/brandEmail.js.
   ============================================================ */

/* ── Reset ──────────────────────────────────────────────────
   These pages no longer load main.css, which is where the
   border-box reset used to come from. Without it every
   width:100% control overflows its padding. */

.aa-page *,
.aa-page *::before,
.aa-page *::after {
    box-sizing: border-box;
}

/* View switching. The behaviour script toggles `.active` on
   .view and `.show`/inline display on the message rows — these
   rules are the other half of that contract, so they are not
   optional styling. */

.view {
    display: none;
}

.view.active {
    display: block;
}

/* ── Shell ──────────────────────────────────────────────────── */

body.aa-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.aa-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 26px 34px;
    border-bottom: 1px solid var(--auth-soft-line);
    color: var(--auth-muted);
    font-family: var(--auth-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.aa-topbar a {
    color: inherit;
    text-decoration: none;
}

.aa-topbar a:hover {
    color: var(--auth-signal-dark);
}

.aa-topbar a:focus-visible {
    outline: 3px solid rgba(19, 94, 168, .38);
    outline-offset: 3px;
}

.aa-brand {
    color: var(--auth-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.02em;
    text-transform: none;
}

.aa-topbar-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.aa-topbar-links a + a {
    position: relative;
}

.aa-topbar-links a + a::before {
    position: absolute;
    left: -10px;
    color: var(--auth-soft-line);
    content: "/";
}

.aa-main {
    display: flex;
    flex: 1;
    align-items: flex-start;
    justify-content: center;
    padding: 56px 20px 72px;
}

.aa-footer {
    padding: 20px 34px 26px;
    border-top: 1px solid var(--auth-soft-line);
    color: #70757c;
    font-family: var(--auth-mono);
    font-size: 9px;
    letter-spacing: .07em;
    line-height: 1.7;
    text-transform: uppercase;
}

.aa-footer a {
    color: var(--auth-signal-dark);
    font-weight: 700;
    text-underline-offset: 3px;
}

/* ── The card (shared by both pages) ────────────────────────── */

.auth-action-container,
.verify-container {
    width: 100%;
    max-width: 520px;
    margin: 0;
    padding: 40px 38px 36px;
    /* The three-colour signal rule that opens every branded email
       and every V3 page, rendered as a border-image so it needs no
       extra element in markup the scripts already own. */
    border: 1px solid var(--auth-line);
    border-top: 4px solid var(--auth-signal);
    background: var(--auth-panel);
    box-shadow: 8px 8px 0 rgba(23, 25, 28, .08);
    border-radius: 0;
    text-align: left;
}

.auth-action-container h2,
.verify-container h1,
.verify-container h2 {
    margin: 0 0 12px;
    color: var(--auth-ink);
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.12;
}

.auth-action-container p,
.verify-container p {
    margin: 0 0 14px;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.6;
}

/* ── Status icon → mono eyebrow ─────────────────────────────
   The old 80px gradient circle is the single most off-brand
   element on these pages. V3 has no circles and no gradients,
   so the state is carried the way the emails carry it: a mono
   kicker with a signal rule, recoloured per state. */

.action-icon,
.verify-icon {
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    margin: 0 0 18px;
    border: 1px solid var(--auth-ink);
    border-bottom-width: 3px;
    border-bottom-color: var(--auth-signal);
    border-radius: 0;
    background: rgba(23, 25, 28, .03);
    font-size: 21px;
    line-height: 1;
}

.action-icon.success {
    border-bottom-color: var(--auth-green);
}

.action-icon.error {
    border-bottom-color: #a8250c;
}

/* ── Controls ───────────────────────────────────────────────── */

.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--auth-muted);
    font-family: var(--auth-mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.form-group input,
.form-group select {
    width: 100%;
}

.form-group input.error {
    border-color: var(--auth-signal) !important;
}

.password-requirements {
    margin: 16px 0 20px;
    padding: 14px 16px;
    border-left: 3px solid var(--auth-blue);
    background: rgba(23, 25, 28, .03);
    border-radius: 0;
    text-align: left;
}

.password-requirements h4 {
    margin: 0 0 8px;
    color: var(--auth-muted);
    font-family: var(--auth-mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    color: var(--auth-muted);
    font-size: 13px;
    transition: color .15s ease;
}

.requirement.met {
    color: var(--auth-green);
    font-weight: 600;
}

.requirement .icon {
    width: 14px;
    text-align: center;
}

/* ── Buttons ────────────────────────────────────────────────
   Same geometry as .btn-submit in auth-v3.css: square, ink
   hairline, signal fill, 5px hard offset that collapses on
   hover. `!important` because both pages carry inline
   `style="display:block;color:#fff"` on the anchor variants. */

.btn-primary-action,
.verify-container .btn-primary {
    display: block;
    width: 100%;
    min-height: 50px;
    padding: 14px 20px;
    border: 1px solid var(--auth-ink);
    border-radius: 0 !important;
    background: #c93613;
    box-shadow: 5px 5px 0 var(--auth-ink);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .01em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

.btn-primary-action:hover,
.verify-container .btn-primary:hover {
    background: var(--auth-signal-dark);
    box-shadow: 2px 2px 0 var(--auth-ink);
    transform: translate(3px, 3px);
}

.btn-primary-action:disabled {
    border-color: var(--auth-soft-line);
    background: #d8d4ca;
    box-shadow: 5px 5px 0 var(--auth-soft-line);
    color: #8b8f96;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary-action,
.verify-container .btn-resend {
    display: block;
    width: 100%;
    min-height: 46px;
    margin-top: 12px;
    padding: 12px 20px;
    border: 1px solid var(--auth-ink);
    border-radius: 0 !important;
    background: transparent;
    color: var(--auth-ink) !important;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .14s ease, color .14s ease;
}

.btn-secondary-action:hover,
.verify-container .btn-resend:hover {
    background: var(--auth-ink);
    color: var(--auth-panel) !important;
}

.btn-secondary-action:disabled,
.verify-container .btn-resend:disabled {
    border-color: var(--auth-soft-line);
    color: #8b8f96 !important;
    cursor: not-allowed;
}

.btn-primary-action:focus-visible,
.btn-secondary-action:focus-visible,
.verify-container .btn:focus-visible {
    outline: 3px solid rgba(19, 94, 168, .38);
    outline-offset: 3px;
}

/* ── Messages / spinner ─────────────────────────────────────
   `display` is deliberately untouched: the scripts flip these
   rows between none and block. */

.error-message,
.success-message {
    display: none;
    margin-bottom: 14px;
    padding: 11px 14px;
    border-left: 3px solid var(--auth-signal);
    border-radius: 0;
    background: rgba(23, 25, 28, .03);
    font-size: 13.5px;
    line-height: 1.55;
}

.success-message {
    border-left-color: var(--auth-green);
}

.error-message.show,
.success-message.show {
    display: block;
}

.loading-spinner {
    padding: 34px 0;
    text-align: center;
}

.loading-spinner p {
    margin: 0;
    color: var(--auth-muted);
    font-family: var(--auth-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.loading-spinner .spinner {
    position: relative;
    overflow: hidden;
    width: 132px;
    height: 3px;
    margin: 0 auto 16px;
    border: 0;
    border-radius: 0;
    background: var(--auth-soft-line);
}

.loading-spinner .spinner::after {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 44px;
    background: var(--auth-signal);
    animation: aa-march 1.1s ease-in-out infinite;
    content: "";
}

@keyframes aa-march {
    0% { left: -44px; }
    100% { left: 132px; }
}

@media (prefers-reduced-motion: reduce) {
    .loading-spinner .spinner::after { animation-duration: 3s; }
    .btn-primary-action,
    .btn-secondary-action,
    .verify-container .btn { transition: none; }
}

/* ── Trailing help / links ──────────────────────────────────── */

.help-link,
.verify-container .help-text {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--auth-soft-line);
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.6;
}

.help-link a,
.verify-container .help-text a {
    color: var(--auth-signal-dark);
    font-weight: 700;
    text-underline-offset: 3px;
}

/* ── verify-email.html specifics ────────────────────────────── */

.email-highlight {
    display: inline-block;
    padding: 3px 8px;
    border: 1px solid var(--auth-soft-line);
    background: rgba(23, 25, 28, .04);
    color: var(--auth-ink);
    font-family: var(--auth-mono);
    font-size: 13px;
    font-weight: 700;
    word-break: break-all;
}

.steps-list {
    margin: 20px 0;
    padding: 14px 16px;
    border-left: 3px solid var(--auth-blue);
    background: rgba(23, 25, 28, .03);
}

.steps-list h4 {
    margin: 0 0 10px;
    color: var(--auth-muted);
    font-family: var(--auth-mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.steps-list ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: aa-step;
}

.steps-list li {
    position: relative;
    margin-bottom: 10px;
    padding-left: 38px;
    color: var(--auth-muted);
    font-size: 14.5px;
    line-height: 1.55;
    counter-increment: aa-step;
}

.steps-list li::before {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--auth-ink);
    color: var(--auth-ink);
    content: counter(aa-step, decimal-leading-zero);
    font-family: var(--auth-mono);
    font-size: 10px;
    font-weight: 800;
}

.action-buttons {
    margin-top: 22px;
}

.resend-timer {
    margin-top: 10px;
    color: var(--auth-muted);
    font-family: var(--auth-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-align: center;
    text-transform: uppercase;
}

/* The countdown row ships with an inline amber style, so the
   palette correction has to outrank it. */
#graceCountdown {
    padding: 11px 14px !important;
    border: 0 !important;
    border-left: 3px solid var(--auth-yellow, #b8860b) !important;
    border-radius: 0 !important;
    background: rgba(23, 25, 28, .03) !important;
    color: var(--auth-ink) !important;
    font-size: 13.5px !important;
    text-align: left !important;
}

/* ── Small screens ──────────────────────────────────────────── */

@media (max-width: 640px) {
    .aa-topbar,
    .aa-footer {
        padding-right: 18px;
        padding-left: 18px;
    }

    .aa-main {
        padding: 30px 14px 44px;
    }

    .auth-action-container,
    .verify-container {
        padding: 30px 22px 28px;
        box-shadow: 5px 5px 0 rgba(23, 25, 28, .08);
    }

    .auth-action-container h2,
    .verify-container h1,
    .verify-container h2 {
        font-size: 23px;
    }
}
