/* Signed-out pages (sign-in, sign-up, welcome, expired), 2026-11-22 redesign by agent AUTH.
   Loaded by inc/auth_chrome.php after v2.css and theme-dark.css; every rule is scoped to body.au-page so the shared
   .v2-auth* rules stay as they are for anything else. Colours through tokens only; the Microsoft button uses the
   colours Microsoft's brand guidelines require, defined for the light theme and for both dark themes below. */

.au-page {
    --au-ms-bg: #ffffff; --au-ms-border: #8c8c8c; --au-ms-text: #5e5e5e; --au-ms-hover: #f3f3f3;
    grid-template-rows: 64px 1fr auto;
    background: var(--bg-app);
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
}
html[data-theme="dark"] .au-page { --au-ms-bg: #2f2f2f; --au-ms-border: #2f2f2f; --au-ms-text: #ffffff; --au-ms-hover: #3b3b3b; }
html[data-theme="dark"][data-theme-variant="lightsoff"] .au-page { --au-ms-border: #5e5e5e; }

/* Header: brand left, theme button (fixed, shared) right; no bar, no border */
.au-page .v2-auth-header { justify-content: flex-start; gap: 12px; padding: 0 64px 0 24px; border-bottom: 0; background: transparent; }
.au-page .v2-auth-brand { gap: 10px; font-size: 15px; font-weight: 650; border-radius: 6px; }
.au-page .v2-auth-brand img { width: 24px; height: 24px; }
.au-page .v2-auth-product { display: inline-block; color: var(--text-muted); font-size: 13px; font-weight: 500; line-height: 20px; }
.au-page .dc-auth-theme { top: 14px; right: 16px; border-color: var(--border); background: var(--bg-surface); }
.au-page a:focus-visible, .au-page button:focus-visible, .au-page input:focus-visible, .au-page summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Main column */
.au-page .v2-auth-main { padding: 32px 24px 48px; align-content: center; }
.au-page .v2-auth-panel { width: min(100%, 400px); padding: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-surface); box-shadow: none; }
.au-page .v2-auth-panel .auth-title { font-size: 22px; font-weight: 650; line-height: 1.3; letter-spacing: 0; }
.au-page .v2-auth-panel .auth-subtitle { margin: 6px 0 24px; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.au-page .v2-auth-panel .auth-subtitle strong { color: var(--text-primary); font-weight: 600; overflow-wrap: anywhere; }

/* Fields */
.au-page .v2-auth-panel .form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.au-page .v2-auth-panel .form-group > label { margin: 0; color: var(--text-primary); font-size: 13px; font-weight: 600; }
.au-page .v2-auth-panel .form-control { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border-control); border-radius: 6px; background: var(--bg-surface); color: var(--text-primary); font-size: 14px; box-shadow: none; }
.au-page .v2-auth-panel .form-control::placeholder { color: var(--text-muted); opacity: 1; }
.au-page .v2-auth-panel .form-control:hover { border-color: var(--border-control-hover, var(--border-control)); }
.au-page .v2-auth-panel .form-control:focus { border-color: var(--accent); outline: 2px solid var(--focus-ring); outline-offset: 1px; box-shadow: none; }
.au-page .v2-auth-panel .form-control[aria-invalid="true"] { border-color: var(--danger); }
.au-page .v2-auth-panel .pw-wrap input { padding-right: 64px; }
.au-page .v2-auth-panel .pw-toggle { right: 6px; height: 28px; padding: 0 10px; border-radius: 4px; color: var(--text-secondary); font-size: 12.5px; font-weight: 600; }
.au-page .v2-auth-panel .pw-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.au-page .v2-auth-panel .form-hint, .au-page .v2-auth-panel .pw-hint, .au-page .v2-auth-panel .pw-match { margin: 0; color: var(--text-muted); font-size: 12.5px; line-height: 1.45; }
.au-page .v2-auth-panel .pw-match.is-ok { color: var(--text-secondary); }
.au-page .v2-auth-panel .pw-match.is-bad { color: var(--badge-deny-text); }
.au-page .v2-auth-panel .pw-strength { margin-top: 2px; }
.au-page .v2-caps-warning { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--badge-ask-text); font-size: 12.5px; font-weight: 500; }
.au-page .v2-caps-warning[hidden] { display: none; }
.au-page .v2-caps-warning::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.au-check { display: flex; align-items: center; gap: 8px; margin: 4px 0 20px; color: var(--text-secondary); font-size: 13px; }
.au-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.au-check label { margin: 0; cursor: pointer; font-weight: 500; }

/* Buttons */
.au-page .v2-auth-panel .btn-lg, .au-page .v2-auth-panel .btn.w-full { min-height: 40px; border-radius: 6px; font-size: 14px; font-weight: 600; }
.au-page .v2-auth-panel .btn[aria-busy="true"] { opacity: .7; cursor: progress; }
/* Microsoft sign-in, per Microsoft's identity brand guidelines: four-square logo 21 px, "Sign in with Microsoft",
   Segoe UI semibold 15 px, 41 px tall, 12 px padding and gap, light #fff / #8c8c8c / #5e5e5e, dark #2f2f2f / #fff. */
.au-page .v2-auth-panel .btn.btn-ms { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 41px; padding: 0 12px; border: 1px solid var(--au-ms-border); border-radius: 0; background: var(--au-ms-bg); color: var(--au-ms-text); font-family: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", var(--font-sans); font-size: 15px; font-weight: 600; text-decoration: none; }
.au-page .v2-auth-panel .btn.btn-ms:hover { border-color: var(--au-ms-border); background: var(--au-ms-hover); color: var(--au-ms-text); }
.au-page .v2-auth-panel .btn-ms svg { width: 21px; height: 21px; flex: none; }
.au-page .v2-auth-panel .auth-divider { margin: 20px 0; color: var(--text-muted); font-size: 12.5px; }
.au-page .v2-auth-panel .auth-divider::before, .au-page .v2-auth-panel .auth-divider::after { background: var(--divider, var(--border)); }

/* Messages: 1px border on all sides, tone from tokens, optional bold first line */
.au-page .v2-auth-panel .auth-alert { display: grid; gap: 2px; margin: 0 0 20px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-subtle); color: var(--text-primary); font-size: 13px; line-height: 1.5; }
.au-page .v2-auth-panel .auth-alert strong { font-weight: 650; }
.au-page .v2-auth-panel .auth-alert.error { border-color: var(--danger-border); background: var(--danger-subtle); color: var(--badge-deny-text); }
.au-page .v2-auth-panel .auth-alert.warn { border-color: var(--warning-border); background: var(--warning-subtle); color: var(--badge-ask-text); }
.au-page .v2-auth-panel .auth-alert.info, .au-page .v2-auth-panel .auth-alert.success { border-color: var(--border); background: var(--bg-subtle); color: var(--text-primary); }

/* Footer line inside the panel, and the page footer */
.au-page .v2-auth-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--divider, var(--border)); color: var(--text-secondary); font-size: 13px; text-align: left; }
.au-page .v2-auth-footer a, .au-page .au-link { color: var(--accent-text); font-weight: 600; text-decoration: none; border-radius: 4px; }
.au-page .v2-auth-footer a:hover, .au-page .au-link:hover { text-decoration: underline; }
.au-page .v2-auth-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding: 16px 24px 24px; color: var(--text-muted); font-size: 12px; }
.au-page .v2-auth-legal .au-host { font-family: var(--font-mono); font-size: 11.5px; }

/* Product column beside the form on wide screens (inc/auth_hero.php) */
.au-page .v2-auth-hero { max-width: 380px; }
.au-page .au-hero-lead { margin: 0; color: var(--text-primary); font-size: 18px; font-weight: 500; line-height: 1.45; }
.au-page .au-hero-list { display: grid; gap: 16px; margin: 28px 0 0; padding: 24px 0 0; border-top: 1px solid var(--divider, var(--border)); }
.au-page .au-hero-list div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; }
.au-page .au-hero-list dt { color: var(--text-primary); font-size: 13px; font-weight: 600; }
.au-page .au-hero-list dd { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
@media (min-width: 1080px) {
    .au-page .v2-auth-main.has-hero { grid-template-columns: minmax(0, 380px) minmax(0, 400px); gap: clamp(56px, 8vw, 120px); }
}

/* Welcome: the path to a first endpoint, then the join option */
.au-page .v2-auth-panel.wlc-card { width: min(100%, 480px); }
.au-steps { display: grid; gap: 8px; margin: 0 0 24px; padding: 0 0 0 20px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.au-steps li::marker { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.au-steps li.is-here { color: var(--text-primary); font-weight: 600; }
.au-page .wlc-panel { padding: 0; border: 0; background: transparent; }
.au-page .wlc-panel h2 { margin: 0 0 4px; font-size: 15px; font-weight: 650; }
.au-page .wlc-panel p { margin: 0 0 12px; color: var(--text-secondary); font-size: 13px; }
.au-page .wlc-id { gap: 8px; }
.au-page .wlc-id code { display: flex; align-items: center; min-height: 36px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-subtle); color: var(--text-primary); font-family: var(--font-mono); font-size: 13px; }
.au-page .wlc-id .btn { min-height: 36px; }
.au-page .wlc-meta { margin-top: 8px; color: var(--text-muted); font-size: 12.5px; }
.au-wlc-sec { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--divider, var(--border)); }
.au-page .wlc-panel .au-wlc-next { margin: 12px 0 0; color: var(--text-muted); font-size: 12.5px; line-height: 1.45; }

/* Locked console */
.au-lock-glyph { display: block; margin: 0 0 16px; color: var(--text-secondary); }
.au-contact { margin: 0 0 20px; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.au-contact a { color: var(--accent-text); font-weight: 600; overflow-wrap: anywhere; }

/* Phone: no card, larger touch targets, 16 px inputs so iOS does not zoom */
@media (max-width: 640px) {
    .au-page { grid-template-rows: 56px 1fr auto; background: var(--bg-surface); }
    .au-page .v2-auth-header { padding: 0 60px 0 16px; }
    .au-page .v2-auth-product { display: none; }
    .au-page .dc-auth-theme { top: 10px; right: 12px; }
    .au-page .v2-auth-main { align-content: start; padding: 24px 16px 32px; }
    .au-page .v2-auth-panel, .au-page .v2-auth-panel.wlc-card { width: 100%; padding: 0; border: 0; background: transparent; }
    .au-page .v2-auth-panel .form-control { min-height: 44px; font-size: 16px; }
    .au-page .v2-auth-panel .btn-lg, .au-page .v2-auth-panel .btn.w-full { min-height: 44px; }
    .au-page .v2-auth-panel .btn.btn-ms { min-height: 44px; }
    .au-page .wlc-id { flex-wrap: wrap; }
    .au-page .wlc-id code { flex: 1 1 100%; }
    .au-page .wlc-id .btn { flex: 1 1 100%; }
    .au-page .v2-auth-legal { padding: 12px 16px 20px; }
}
@media (prefers-reduced-motion: reduce) { .au-page * { transition: none !important; } }
.au-page .v2-auth-panel .form-error { margin: 0; color: var(--badge-deny-text); font-size: 12.5px; font-weight: 500; }
.au-page .v2-auth-panel .form-error[hidden] { display: none; }
