/* =============================================================================
   dMACQ - sign-in screens (shared). One look for every page a signed-out user sees, built from the same tokens
   as the rebuilt app pages (resources/css/dms-page-bs5.css: --dr-* colours, 4/8/16/24 spacing, Noto Sans,
   brand #2950da, Bootstrap Icons).

   Load: include/auth_head.php (Noto Sans, scoped Bootstrap 5.3.8, Bootstrap Icons, this file, dms-auth-dialogs.css).
   error_401.php and license.php link only Noto Sans, Bootstrap Icons and this file (they can be printed inside the
   app shell, where a second copy of the scoped Bootstrap 5 sheet would reorder the shell's cascade).
   Scope: every rule sits under .auth-shell (the page wrapper), not under <body>. error_401.php is also injected
   into the open app shell as HTML (resources/js/ajax_common_request.js puts a redirected AJAX response into a div
   or a bootbox): its <body> is dropped there, so nothing here may style html/body/* globally. body.dms-auth only
   adds the full-window background on the stand-alone page.

   Markup:
     <body class="dms-auth">
       <main class="auth-shell bs5">                    (error_401.php: <div ...>, it can land inside the shell)
         <div class="auth-stack">                       (.auth-stack-wide for long reading, e.g. license.php)
           <section class="auth-card" aria-labelledby="auth_title">
             <div class="auth-card-head">  .auth-logo  .auth-eyebrow  h1.auth-title#auth_title  p.auth-subtitle
             <div class="auth-card-body">  .auth-alert  .auth-field  .auth-btn  .auth-row ...
             <div class="auth-card-foot">  help / legal text
           </section>
           <div class="auth-meta"> ... </div>           (trust line under the card)
         </div>
       </main>

   Components
     .auth-field > .auth-label-row > label.auth-label (+ .auth-link)
                 > .auth-input-wrap > i.auth-input-icon + input.auth-input (+ button.auth-input-action)
                 > .auth-help                            (hint under a field)
       Errors: jquery.validate inserts label.error after the input (inside .auth-input-wrap); Parsley adds
       ul.parsley-errors-list; both, and .auth-error, render as the same red line under the field. The input
       turns red for .error / .is-invalid / .parsley-error / [aria-invalid="true"].
     .auth-btn (primary, full width)  .auth-btn-secondary (outline)  .auth-actions (row of buttons)
     .auth-alert + .auth-alert-danger | -success | -info | -warning, with .auth-alert-icon / .auth-alert-title
     .auth-status (status / error pages): .auth-status-icon(-danger|-warning|-info) .auth-code
     .auth-otp-input, .auth-countdown, .auth-captcha, .auth-note, .auth-divider, .auth-legal (licence text)
     .auth-particles (login.php's particle canvas, behind the card)
     SweetAlert2 dialogs: resources/css/dms-auth-dialogs.css (loaded by include/auth_head.php after this file).
     Session-timeout dialog in the app shell: resources/css/dms-session-timeout.css.

   Used by: login.php, forgot_password.php, reset.php, renew_password_form.php, otp.php, otp_login.php,
            license.php, error_401.php, error_405.php, concurrent_msg.php, invaliduser.php, message.php,
            messagelogin.php, ADpassword.php
   ============================================================================= */

.auth-shell {
    --dr-text: #0f172a;
    --dr-body: #334155;
    --dr-muted: #64748b;
    --dr-faint: #94a3b8;
    --dr-line: #e2e8f0;
    --dr-line-soft: #eef2f6;
    --dr-soft: #f8fafc;
    --dr-brand-soft: #eef2ff;
    --dr-brand-line: #c7d2fe;
    --dr-s1: 4px;
    --dr-s2: 8px;
    --dr-s3: 16px;
    --dr-s4: 24px;
    --auth-primary: #2950da;          /* 6.4:1 with white text */
    --auth-primary-hover: #2243b6;
    --auth-primary-active: #1d3a9c;
    --auth-ring: 0 0 0 3px rgba(41, 80, 218, .18);
    --auth-danger: #b91c1c;           /* error text, 6.5:1 on white */
    --auth-danger-line: #dc2626;      /* error border */
    --auth-success: #047857;
    --auth-field-h: 44px;
    --auth-radius: 10px;
    --auth-card-radius: 16px;
    --auth-font: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 40px var(--dr-s3);
    font-family: var(--auth-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--dr-body);
    text-align: left;
    -webkit-font-smoothing: antialiased;
}
.auth-shell *,
.auth-shell *::before,
.auth-shell *::after { box-sizing: border-box; }

/* ---- stand-alone page: full window, soft brand-tinted background --------------------------------------------
   Only when the shell is a direct child of <body> (the stand-alone page). license.php and error_401.php can also be
   printed inside the app shell (index.php?rq=..., mailbox pages include error_401.php): there .auth-shell sits in
   #check_selection, so none of these match, and those two pages print a bare <body> (a second <body> tag would
   merge its class into the shell's). */
body.dms-auth,
body:has(> .auth-shell) {
    margin: 0;
    min-height: 100vh;
    background-color: #f4f6fb;
    background-image:
        radial-gradient(1100px 520px at 12% -8%, rgba(41, 80, 218, .11), transparent 62%),
        radial-gradient(900px 480px at 108% 108%, rgba(252, 85, 35, .07), transparent 60%);
    background-attachment: fixed;
    font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #334155;
}
body > .auth-shell { min-height: 100vh; }
/* faint dot grid that fades out towards the edges (texture, not decoration) */
body > .auth-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(15, 23, 42, .07) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 72%);
    mask-image: radial-gradient(ellipse at center, #000 0%, transparent 72%);
}

/* login.php's particle network (particles.js) sits behind the card */
.auth-particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .55; }  /* softer on the light page */
.auth-particles canvas { display: block; }

.auth-stack {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--dr-s3);
    width: 100%;
    max-width: 440px;
}
.auth-stack-wide { max-width: 880px; }

/* ---- card --------------------------------------------------------------------------------------------------- */
.auth-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--dr-line);
    border-radius: var(--auth-card-radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 18px 40px -18px rgba(15, 23, 42, .22);
    animation: authRise .45s cubic-bezier(.16, 1, .3, 1) both;
}
/* thin brand line on top: the same orange + blue as the logo */
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #fc5523 0%, #fc5523 18%, var(--auth-primary) 18%, var(--auth-primary) 100%);
}
@keyframes authRise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.auth-card-head { padding: 32px 32px 0; }
.auth-card-body { padding: 24px 32px 28px; }
.auth-card-foot {
    padding: 14px 32px;
    border-top: 1px solid var(--dr-line-soft);
    background: var(--dr-soft);
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--dr-muted);
    text-align: center;
}
.auth-card-foot p { margin: 0; }
.auth-card-foot p + p { margin-top: 4px; }

.auth-logo { display: inline-flex; align-items: center; margin: 0 0 20px; line-height: 0; }
.auth-logo svg,
.auth-logo img { display: block; height: 32px; width: auto; max-width: 180px; }
.auth-shell .auth-logo > a,
.auth-shell a.auth-logo { display: inline-block; border-radius: 6px; }
.auth-shell .auth-logo > a:focus-visible,
.auth-shell a.auth-logo:focus-visible { outline: 2px solid var(--auth-primary); outline-offset: 2px; box-shadow: none; }

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    padding: 3px 10px;
    border: 1px solid var(--dr-brand-line);
    border-radius: 999px;
    background: var(--dr-brand-soft);
    color: var(--auth-primary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.auth-eyebrow .bi,
.auth-eyebrow .fa { font-size: 12px; }

.auth-shell .auth-title {
    margin: 0 0 4px;
    padding: 0;
    font-family: var(--auth-font);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.015em;
    color: var(--dr-text);
    text-transform: none;
}
.auth-shell .auth-subtitle {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--dr-muted);
}

/* ---- fields ------------------------------------------------------------------------------------------------- */
.auth-field { margin: 0 0 var(--dr-s3); }
.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--dr-s2);
    margin: 0 0 6px;
}
.auth-shell .auth-label {
    display: block;
    margin: 0;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--dr-body);
}
.auth-label-row > .auth-label { margin: 0; }
.auth-field > .auth-label { margin: 0 0 6px; }

.auth-input-wrap {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}
.auth-input-icon {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: var(--auth-field-h);
    color: var(--dr-faint);
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
    transition: color .15s ease;
}
.auth-input-wrap:focus-within > .auth-input-icon { color: var(--auth-primary); }

/* the field itself; the repeated class beats legacy element rules (Bootstrap 2 input[type=...], Metronic).
   The scoped Bootstrap 5 build forces height / margin / padding / radius on .form-control with !important,
   and the pages keep that class, so those four are !important here too. */
.auth-shell .auth-input.auth-input {
    display: block;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    height: var(--auth-field-h) !important;
    min-height: var(--auth-field-h);
    margin: 0 !important;
    padding: 0 14px !important;
    border: 1px solid #8592a6;        /* 3.2:1 on white: the field edge is visible (WCAG 1.4.11) */
    border-radius: var(--auth-radius) !important;
    background: #fff;
    box-shadow: none;
    font-family: var(--auth-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--dr-text);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.auth-shell .auth-input-wrap > .auth-input-icon ~ .auth-input.auth-input { padding-left: 42px !important; }
.auth-shell .auth-input.auth-input.has-action { padding-right: 46px !important; }
.auth-shell .auth-input.auth-input::placeholder { color: var(--dr-muted); font-weight: 400; opacity: 1; }  /* 4.8:1 */
.auth-shell .auth-input.auth-input:hover { border-color: #64748b; }
.auth-shell .auth-input.auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: var(--auth-ring);
    outline: 0;
}
.auth-shell .auth-input.auth-input:disabled,
.auth-shell .auth-input.auth-input[readonly] {
    background: var(--dr-soft);
    color: var(--dr-muted);
    cursor: not-allowed;
}
/* error state - whichever validator marked it */
.auth-shell .auth-input.auth-input:is(.error, .is-invalid, .parsley-error, [aria-invalid="true"]) {
    border-color: var(--auth-danger-line);
    background: #fffafa;
}
.auth-shell .auth-input.auth-input:is(.error, .is-invalid, .parsley-error, [aria-invalid="true"]):focus {
    border-color: var(--auth-danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
    outline: 2px solid var(--auth-danger);
    outline-offset: 2px;
}
.auth-input-wrap:has(> .auth-input:is(.error, .is-invalid, .parsley-error)) > .auth-input-icon { color: var(--auth-danger-line); }
/* Parsley marks a passing field .parsley-success: keep it neutral (no green flash while typing) */
.auth-shell .auth-input.auth-input.parsley-success:not(.error, .is-invalid, [aria-invalid="true"]) { border-color: #8592a6; background: #fff; }
.auth-shell .auth-input.auth-input.parsley-success:not(.error, .is-invalid, [aria-invalid="true"]):focus { border-color: var(--auth-primary); }

/* icon button inside the field (show / hide password) */
.auth-shell .auth-input-action {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: var(--dr-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.auth-shell .auth-input-action:hover { background: #f1f5f9; color: var(--dr-text); }
.auth-shell .auth-input-action:focus-visible { outline: 2px solid var(--auth-primary); outline-offset: -2px; box-shadow: none; color: var(--dr-text); }

/* error line under a field: jquery.validate label.error, Parsley list, or .auth-error */
.auth-shell .auth-input-wrap > label.error,
.auth-shell .auth-field label.error,
.auth-shell .auth-error,
.auth-shell .parsley-errors-list li {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex: 1 1 100%;
    order: 9;
    width: 100%;
    margin: 6px 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--auth-danger);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
    text-transform: none;
}
.auth-shell .auth-input-wrap > label.error::before,
.auth-shell .auth-field label.error::before,
.auth-shell .auth-error::before,
.auth-shell .parsley-errors-list li::before {
    content: "\f332";                 /* bi-exclamation-circle-fill */
    flex: none;
    margin-top: 1px;
    font-family: "bootstrap-icons";
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
}
.auth-shell .auth-input-wrap > label.error label,
.auth-shell .auth-field label.error label {
    display: inline;
    max-width: none !important;
    margin: 0;
    padding: 0;
    color: inherit !important;
    font: inherit;
}
.auth-shell .auth-field label.error b { font-weight: 600; }
.auth-shell label.error:empty,
.auth-shell label.error[style*="display: none"] { display: none !important; }
.auth-shell .parsley-errors-list {
    flex: 1 1 100%;
    order: 10;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}
.auth-shell .parsley-errors-list:empty { display: none; }
/* two validators on one field (reset.php, renew_password_form.php): show one message - jquery.validate's wins */
.auth-shell .auth-input-wrap:has(> label.error:not(:empty):not([style*="display: none"])) > .parsley-errors-list { display: none; }
.auth-shell .parsley-errors-list li + li { margin-top: 2px; }

.auth-help { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--dr-muted); }

/* ---- links -------------------------------------------------------------------------------------------------- */
.auth-shell .auth-link {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
}
.auth-shell .auth-link:hover { color: var(--auth-primary-hover); text-decoration: underline; text-underline-offset: 2px; }
.auth-shell .auth-link:focus-visible { outline: 2px solid var(--auth-primary); outline-offset: 2px; box-shadow: none; }
.auth-label-row .auth-link { font-size: 12.5px; }

/* ---- buttons ------------------------------------------------------------------------------------------------ */
.auth-shell .auth-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--dr-s2);
    width: 100%;
    height: var(--auth-field-h);
    margin: 0;
    padding: 0 20px;
    border: 1px solid var(--auth-primary);
    border-radius: var(--auth-radius);
    background: var(--auth-primary);
    background-image: none;
    box-shadow: 0 4px 12px rgba(41, 80, 218, .25);
    color: #fff;
    font-family: var(--auth-font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .01em;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    white-space: nowrap;
    cursor: pointer;
    filter: none;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.auth-shell .auth-btn:hover {
    border-color: var(--auth-primary-hover);
    background: var(--auth-primary-hover);
    color: #fff;
    box-shadow: 0 6px 16px rgba(41, 80, 218, .3);
    text-decoration: none;
}
.auth-shell .auth-btn:active { border-color: var(--auth-primary-active); background: var(--auth-primary-active); transform: translateY(1px); box-shadow: 0 2px 6px rgba(41, 80, 218, .25); }
.auth-shell .auth-btn:focus-visible { outline: 2px solid var(--auth-primary); outline-offset: 2px; box-shadow: none; }
.auth-shell .auth-btn:disabled,
.auth-shell .auth-btn.disabled,
.auth-shell .auth-btn[aria-disabled="true"] {
    opacity: .6;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
/* busy (page JS disables the button and puts a spinner in it while it works): keep the colour, show progress */
.auth-shell .auth-btn:disabled:has(.fa-spin, .spinner-border, .bi-arrow-repeat) { opacity: .85; cursor: progress; }
.auth-shell .auth-btn .bi,
.auth-shell .auth-btn .fa,
.auth-shell .auth-btn [class^="icon-"] { font-size: 15px; line-height: 1; margin: 0; }
.auth-shell .auth-btn:not(:disabled):hover > .bi-arrow-right,
.auth-shell .auth-btn:not(:disabled):hover > .fa-arrow-right { transform: translateX(2px); }
.auth-shell .auth-btn > .bi-arrow-right,
.auth-shell .auth-btn > .fa-arrow-right { transition: transform .15s ease; }

/* pages that keep .btn next to .auth-btn: the scoped Bootstrap 5 .btn focus / active rules read --bs-btn-* variables
   a plain .btn does not set (transparent button on keyboard focus or press) */
.auth-shell .auth-btn.btn:focus-visible { border-color: var(--auth-primary); background: var(--auth-primary); color: #fff; }
.auth-shell .auth-btn.btn:active,
.auth-shell .auth-btn.btn:first-child:active { border-color: var(--auth-primary-active); background: var(--auth-primary-active); color: #fff; }

.auth-shell .auth-btn-secondary {
    border-color: #cbd5e1;
    background: #fff;
    box-shadow: none;
    color: var(--dr-body);
}
.auth-shell .auth-btn-secondary:hover {
    border-color: var(--dr-faint);
    background: var(--dr-soft);
    box-shadow: none;
    color: var(--dr-text);
}
.auth-shell .auth-btn-secondary:active { border-color: var(--dr-faint); background: #f1f5f9; color: var(--dr-text); }
.auth-shell .auth-btn-secondary.btn:focus-visible { border-color: #cbd5e1; background: #fff; color: var(--dr-body); }
.auth-shell .auth-btn-secondary.btn:active,
.auth-shell .auth-btn-secondary.btn:first-child:active { border-color: var(--dr-faint); background: #f1f5f9; color: var(--dr-text); }

.auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: var(--dr-s4);
}
.auth-actions > .auth-btn { flex: 1 1 140px; width: auto; }
.auth-actions-end { justify-content: flex-end; }
.auth-actions-end > .auth-btn { flex: 0 0 auto; }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--dr-s2);
    margin-top: var(--dr-s3);
    font-size: 13px;
    color: var(--dr-muted);
}
.auth-row-center { justify-content: center; text-align: center; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: var(--dr-s4) 0 var(--dr-s3);
    color: var(--dr-faint);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--dr-line); }

/* ---- alerts ------------------------------------------------------------------------------------------------- */
.auth-shell .auth-alert {
    --auth-alert-bg: var(--dr-brand-soft);
    --auth-alert-line: var(--dr-brand-line);
    --auth-alert-text: #1e3a8a;
    --auth-alert-icon: var(--auth-primary);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 var(--dr-s3);
    padding: 12px 14px;
    border: 1px solid var(--auth-alert-line);
    border-radius: var(--auth-radius);
    background: var(--auth-alert-bg);
    background-image: none;
    box-shadow: none;
    color: var(--auth-alert-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    text-align: left;
    text-shadow: none;
}
.auth-shell .auth-alert-danger  { --auth-alert-bg: #fef2f2; --auth-alert-line: #fecaca; --auth-alert-text: #991b1b; --auth-alert-icon: #dc2626; }
.auth-shell .auth-alert-success { --auth-alert-bg: #ecfdf5; --auth-alert-line: #a7f3d0; --auth-alert-text: #065f46; --auth-alert-icon: #059669; }
.auth-shell .auth-alert-warning { --auth-alert-bg: #fffbeb; --auth-alert-line: #fde68a; --auth-alert-text: #92400e; --auth-alert-icon: #d97706; }
.auth-shell .auth-alert-info    { --auth-alert-bg: var(--dr-brand-soft); --auth-alert-line: var(--dr-brand-line); --auth-alert-text: #1e3a8a; --auth-alert-icon: var(--auth-primary); }
.auth-shell .auth-alert > .auth-alert-icon,
.auth-shell .auth-alert > .bi:first-child,
.auth-shell .auth-alert > .fa:first-child {
    flex: none;
    margin-top: 1px;
    color: var(--auth-alert-icon);
    font-size: 16px;
    line-height: 1.25;
}
.auth-shell .auth-alert-title { display: block; margin: 0 0 1px; font-weight: 700; color: inherit; }
.auth-shell .auth-alert-body { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
/* Bootstrap 5 dismissible alerts (button.btn-close[data-bs-dismiss=alert], forgot_password.php): keep the X its size */
.auth-shell .auth-alert > .btn-close { flex: none; order: 3; margin: 0 0 0 auto; }
.auth-shell .auth-alert a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
/* legacy BS2 close "x" kept by page JS */
.auth-shell .auth-alert > .close {
    flex: none;
    order: 3;
    margin: -4px -6px -4px auto;
    padding: 2px 6px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    opacity: .6;
    float: none;
    position: static;
    text-shadow: none;
    cursor: pointer;
}
.auth-shell .auth-alert > .close:hover { opacity: 1; background: rgba(15, 23, 42, .06); }
.auth-shell .auth-alert-shake { animation: authShake .35s ease-in-out; }
@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    25%, 75% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
}

/* plain informational box (password rules, instructions) */
.auth-note {
    margin: 0 0 var(--dr-s3);
    padding: 12px 14px;
    border: 1px solid var(--dr-line);
    border-radius: var(--auth-radius);
    background: var(--dr-soft);
    color: var(--dr-body);
    font-size: 12.5px;
    line-height: 1.6;
}
.auth-note ul { margin: 4px 0 0; padding-left: 18px; }
.auth-note li + li { margin-top: 2px; }
.auth-note-title { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; font-size: 12.5px; font-weight: 700; color: var(--dr-text); }

/* ---- OTP, countdown, captcha ------------------------------------------------------------------------------- */
.auth-shell .auth-input.auth-input.auth-otp-input {
    padding-left: 14px !important;
    padding-right: 14px !important;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: .35em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.auth-shell .auth-input-wrap > .auth-input-icon ~ .auth-input.auth-otp-input { padding-left: 42px !important; padding-right: 42px !important; }
.auth-shell .auth-input.auth-input.auth-otp-input::placeholder { letter-spacing: normal; font-size: 14px; font-weight: 400; }
.auth-countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--dr-muted);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}
.auth-countdown strong { color: var(--dr-text); font-weight: 700; }
.auth-captcha {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 8px;
}
.auth-captcha img {
    display: block;
    height: 52px;
    width: auto;
    border: 1px solid var(--dr-line);
    border-radius: 8px;
    background: #fff;
}

/* ---- status / error pages ---------------------------------------------------------------------------------- */
.auth-status { text-align: center; }
.auth-status .auth-card-head { padding-top: 36px; }
.auth-status .auth-logo { margin-bottom: 24px; }
.auth-status-icon {
    --auth-status-bg: var(--dr-brand-soft);
    --auth-status-fg: var(--auth-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 0 16px;
    border-radius: 16px;
    background: var(--auth-status-bg);
    color: var(--auth-status-fg);
    font-size: 26px;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .04);
}
.auth-status-icon-danger  { --auth-status-bg: #fef2f2; --auth-status-fg: #dc2626; }
.auth-status-icon-warning { --auth-status-bg: #fffbeb; --auth-status-fg: #d97706; }
.auth-status-icon-info    { --auth-status-bg: var(--dr-brand-soft); --auth-status-fg: var(--auth-primary); }
.auth-code {
    display: block;
    margin: 0 0 6px;
    color: var(--dr-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}
.auth-status .auth-subtitle { max-width: 34em; margin-left: auto; margin-right: auto; }
.auth-status .auth-card-body { padding-top: 20px; }
.auth-status .auth-actions { justify-content: center; margin-top: 0; }
.auth-status .auth-actions > .auth-btn { flex: 0 1 auto; width: auto; min-width: 180px; }

/* ---- licence / terms text (HTML stored in the DB) ---------------------------------------------------------- */
.auth-legal {
    max-height: none;
    color: var(--dr-body);
    font-size: 13.5px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}
.auth-legal > :first-child { margin-top: 0; }
.auth-legal > :last-child { margin-bottom: 0; }
.auth-legal :is(h1, h2, h3, h4, h5, h6) { margin: 1.4em 0 .5em; color: var(--dr-text); font-weight: 700; line-height: 1.35; }
.auth-legal h1 { font-size: 20px; }
.auth-legal h2 { font-size: 18px; }
.auth-legal h3 { font-size: 16px; }
.auth-legal :is(h4, h5, h6) { font-size: 14px; }
.auth-legal p { margin: 0 0 .9em; }
.auth-legal :is(ul, ol) { margin: 0 0 .9em; padding-left: 1.4em; }
.auth-shell .auth-legal { overflow-x: auto; }
.auth-shell .auth-legal a { color: var(--auth-primary); text-decoration: underline; text-underline-offset: 2px; }
.auth-shell .auth-legal a:hover { color: var(--auth-primary-hover); }
.auth-shell .auth-legal a:focus-visible { outline: 2px solid var(--auth-primary); outline-offset: 2px; border-radius: 2px; box-shadow: none; }
.auth-shell .auth-legal :is(img, video, iframe) { max-width: 100%; }
.auth-shell .auth-legal :is(img, video) { height: auto; }
.auth-shell .auth-legal pre { white-space: pre-wrap; }
.auth-shell .auth-legal :is(h1, h2, h3, h4, h5, h6):first-child { margin-top: 0; }
.auth-legal table { max-width: 100%; border-collapse: collapse; }
.auth-legal :is(td, th) { padding: 6px 8px; border: 1px solid var(--dr-line); }

/* error_401.php injected into a bootbox dialog in the app shell (ajax_common_request with no target):
   no full-window padding, flat card (only ever matches there - stand-alone pages put .auth-shell in <body>) */
.modal-body > .auth-shell { padding: 0; }
.modal-body > .auth-shell .auth-card { box-shadow: none; animation: none; }
.modal-body > .auth-shell .auth-status .auth-card-head { padding-top: 24px; }

/* ---- under the card ---------------------------------------------------------------------------------------- */
.auth-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 0;
    color: #475569;                   /* on the tinted page background, not the card: 7:1 */
    font-size: 12px;
    font-weight: 500;
}
.auth-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.auth-meta .bi,
.auth-meta .fa { color: #059669; font-size: 13px; }
.auth-meta a { color: var(--dr-body); font-weight: 600; text-decoration: none; }
.auth-meta a:hover { color: var(--auth-primary); text-decoration: underline; }

/* ---- phones ------------------------------------------------------------------------------------------------ */
@media (max-width: 520px) {
    .auth-shell { padding: 20px 16px; align-items: flex-start; }
    .auth-card-head { padding: 26px 20px 0; }
    .auth-card-body { padding: 20px 20px 22px; }
    .auth-card-foot { padding: 12px 20px; }
    .auth-shell .auth-title { font-size: 20px; }
    .auth-status .auth-actions > .auth-btn { flex: 1 1 100%; }
}

/* ---- motion ------------------------------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .auth-card,
    .auth-shell .auth-alert-shake { animation: none; }
    .auth-shell *,
    .auth-shell *::before,
    .auth-shell *::after { transition-duration: 0s !important; }
    .auth-particles { display: none; }
}
