/* ===================================================================
   A2Z Tools sign-in page (/login-signup).

   Built on a2z-tokens.css - the same paper/ink neutrals, brand blue and
   warm offset shadow as the homepage - so it reads as part of the site,
   not a template. Scoped under .au.

   Desktop (>= 920px): two columns, a quiet brand panel beside the form.
   Mobile: a dedicated composition - logo and heading above a full-width
   card, 48px touch targets, safe-area padding - not a shrunk desktop.
   =================================================================== */

.au {
    --au-ink: var(--heading-color, #343a52);
    --au-text: var(--text-color, #111);
    --au-muted: var(--text-muted, #5f5b57);
    --au-line: var(--card-border, #d8d8d8);
    --au-line-soft: var(--card-border-soft, #e8e4e0);
    --au-blue: var(--primary-blue, #2583dc);
    --au-blue-ink: var(--primary-blue-strong, #1a6ec0);
    --au-blue-soft: var(--primary-blue-soft, #eaf3fc);
    --au-ring: var(--primary-blue-ring, rgb(37 131 220 / 38%));
    --au-bad: #b42318; --au-bad-soft: #fef3f2;
    --au-ok: #067647; --au-ok-soft: #ecfdf3;
    --au-r: 14px;
    background: var(--page-background-soft, #fdfbf9);
    color: var(--au-text);
    padding: clamp(16px, 4vw, 48px) max(16px, env(safe-area-inset-right)) clamp(24px, 5vw, 64px) max(16px, env(safe-area-inset-left));
    min-height: calc(100vh - 80px);
}
.au *, .au *::before, .au *::after { box-sizing: border-box; }
.au [hidden] { display: none !important; }
.au a { color: var(--au-blue-ink); }
.au :focus-visible { outline: 3px solid var(--au-ring); outline-offset: 2px; }

.au-shell { max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }

/* ---------- brand panel ---------- */
.au-brand { display: none; }
.au-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--au-ink) !important; text-decoration: none; }
.au-logo img { display: block; }

.au-brand-title { font-size: 1.65rem; line-height: 1.25; margin: 6px 0 0; color: var(--au-ink); font-weight: 800; letter-spacing: -.01em; }
.au-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.au-benefits li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; color: var(--au-muted); line-height: 1.5; font-size: .95rem; }
.au-benefits strong { color: var(--au-ink); }
.au-bi { width: 26px; height: 26px; border-radius: 8px; background: #fff; border: 1px solid var(--au-line-soft); display: grid; place-items: center; }
.au-bi svg { width: 15px; height: 15px; fill: none; stroke: var(--au-blue-ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.au-tiles { margin-top: 8px; display: grid; grid-template-columns: repeat(3, 56px); gap: 10px; }
.au-tiles span { width: 56px; height: 56px; border-radius: 14px; background: #fff; border: 1px solid var(--au-line-soft); display: grid; place-items: center; color: var(--au-blue); font-size: 1.25rem; box-shadow: 0 1px 2px rgb(72 60 52 / 6%); }
.au-tiles span:nth-child(even) { transform: translateY(8px); }

/* ---------- mobile header + card ---------- */
.au-panel { min-width: 0; }
.au-mhead { display: flex; justify-content: center; margin-bottom: 16px; }
.au-card { background: #fff; border: 1px solid var(--au-line); border-radius: 20px; padding: 24px 20px; box-shadow: var(--card-offset, 4px 4px 0 #f8f2ee); max-width: 460px; margin: 0 auto; }
@media (min-width: 520px) and (max-width: 919px) { .au-card { padding: 32px 32px 28px; } }
@media (min-width: 920px) { .au-card { max-width: 420px; } }

.au-title { font-size: clamp(1.45rem, 3.6vw, 1.75rem); line-height: 1.2; margin: 0; color: var(--au-ink); font-weight: 800; letter-spacing: -.01em; text-align: center; }
.au-sub { margin: 6px 0 20px; color: var(--au-muted); text-align: center; font-size: .95rem; }
@media (min-width: 920px) { .au-title, .au-sub { text-align: left; } }

.au-banner { padding: 12px 14px; border-radius: 12px; font-size: .92rem; line-height: 1.45; margin: 0 0 16px; border: 1px solid; }
.au-banner.is-err { background: var(--au-bad-soft); border-color: #fecdca; color: var(--au-bad); }
.au-banner.is-ok { background: var(--au-ok-soft); border-color: #abefc6; color: var(--au-ok); }

/* ---------- segmented tabs ---------- */
.au-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #f3f1ee; border-radius: 12px; margin-bottom: 18px; }
.au-tab { display: grid; place-items: center; min-height: 42px; border-radius: 9px; font-weight: 700; font-size: .95rem; color: var(--au-muted) !important; text-decoration: none; transition: background-color .15s, color .15s, box-shadow .15s; }
.au-tab[aria-current="page"] { background: #fff; color: var(--au-ink) !important; box-shadow: 0 1px 3px rgb(72 60 52 / 16%); }
.au-tab:hover:not([aria-current]) { color: var(--au-ink) !important; }

/* ---------- providers ---------- */
.au-social { display: grid; gap: 10px; }
.au-pv {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 16px;
    border: 1px solid var(--au-line); border-radius: var(--au-r); background: #fff; color: #1f1f1f !important;
    font-weight: 600; font-size: .98rem; text-decoration: none; transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.au-pv:hover { border-color: #b8b3ad; background: #faf9f7; }
.au-pv.is-primary { border-color: #b8b3ad; box-shadow: 0 1px 2px rgb(72 60 52 / 8%); }
.au-pv-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.au-pv[aria-busy="true"] { pointer-events: none; opacity: .7; }
.au-spinner { width: 18px; height: 18px; flex: 0 0 18px; border: 2px solid var(--au-line); border-top-color: var(--au-blue); border-radius: 50%; animation: au-spin .8s linear infinite; }

.au-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--au-muted); font-size: .85rem; }
.au-divider::before, .au-divider::after { content: ""; flex: 1; height: 1px; background: var(--au-line-soft); }

/* ---------- fields ---------- */
.au-form { display: grid; gap: 16px; }
.au-field { display: grid; gap: 6px; min-width: 0; }
.au-field label, .au-label-row label { font-weight: 700; font-size: .9rem; color: var(--au-ink); }
.au-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.au-link { font-size: .88rem; font-weight: 600; text-decoration: none; }
.au-link:hover { text-decoration: underline; }
.au input[type="email"], .au input[type="text"], .au input[type="password"] {
    width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--au-line); border-radius: 12px;
    background: #fff; color: var(--au-text); font: inherit; font-size: 1rem; transition: border-color .15s, box-shadow .15s;
}
.au input:focus { border-color: var(--au-blue); box-shadow: 0 0 0 3px var(--au-ring); outline: none; }
.au input[aria-invalid="true"] { border-color: var(--au-bad); }
.au input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgb(180 35 24 / 22%); }
.au-pw { position: relative; }
.au-pw input { padding-right: 72px; }
.au-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; min-width: 56px; padding: 0 10px;
    border: 0; border-radius: 8px; background: transparent; color: var(--au-blue-ink); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
}
.au-eye:hover { background: var(--au-blue-soft); }
.au-err { margin: 0; color: var(--au-bad); font-size: .85rem; line-height: 1.4; }
.au-err::before { content: "\26A0\FE0E  "; }

.au-check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--au-muted); line-height: 1.45; cursor: pointer; }
.au-check input[type="checkbox"] { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 20px; accent-color: var(--au-blue-ink); }

.au-meter { height: 6px; border-radius: 99px; background: var(--au-line-soft); overflow: hidden; margin-top: 4px; }
.au-meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--au-bad); transition: width .2s, background-color .2s; }
.au-meter-label { margin: 0; min-height: 1.2em; font-size: .82rem; color: var(--au-muted); }
.au-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .84rem; color: var(--au-muted); }
.au-rules li::before { content: "\25CB  "; }
.au-rules li.is-met { color: var(--au-ok); }
.au-rules li.is-met::before { content: "\2713  "; }

/* ---------- submit ---------- */
.au-submit {
    position: relative; min-height: 50px; width: 100%; border: 0; border-radius: var(--au-r); background: var(--au-blue-ink); color: #fff;
    font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background-color .15s, box-shadow .15s;
}
.au-submit:hover { background: #155ea6; }
.au-submit:focus-visible { box-shadow: 0 0 0 3px var(--au-ring); outline: none; }
.au-submit[aria-busy="true"] { pointer-events: none; opacity: .85; }
.au-submit[aria-busy="true"]::after { content: ""; display: inline-block; width: 16px; height: 16px; margin-left: 10px; vertical-align: -3px; border: 2px solid rgb(255 255 255 / 45%); border-top-color: #fff; border-radius: 50%; animation: au-spin .8s linear infinite; }
.au-switch { margin: 2px 0 0; text-align: center; font-size: .92rem; color: var(--au-muted); }
.au-switch a { font-weight: 700; text-decoration: none; }
.au-switch a:hover { text-decoration: underline; }

.au-foot { max-width: 460px; margin: 16px auto 0; text-align: center; font-size: .8rem; color: var(--au-muted); }
@media (min-width: 920px) { .au-foot { margin-left: 0; text-align: left; } }

/* Desktop composition. LAST on purpose: at equal specificity the later rule
   wins regardless of media queries, and the mobile rules above set the same
   properties (the header, the card chrome). */
@media (min-width: 920px) {
    .au-shell { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0; background: #fff; border: 1px solid var(--au-line); border-radius: 22px; box-shadow: var(--card-offset, 4px 4px 0 #f8f2ee), 0 16px 34px -12px rgb(72 60 52 / 16%); overflow: hidden; align-items: stretch; }
    .au-brand {
        display: flex; flex-direction: column; gap: 22px; padding: 44px 40px;
        background: linear-gradient(160deg, var(--au-blue-soft) 0%, #f6f9fd 55%, #fff 100%);
        border-right: 1px solid var(--au-line-soft);
    }
    .au-panel { padding: 40px 48px 32px; }
    .au-mhead { display: none; }
    .au-card { border: 0 !important; box-shadow: none !important; padding: 0 !important; background: none !important; }
}

@keyframes au-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .au *, .au *::before, .au *::after { transition: none !important; animation-duration: 2s !important; }
}
@media (forced-colors: active) {
    .au-card, .au-pv, .au-tab[aria-current="page"], .au input, .au-submit { border: 1px solid CanvasText; }
    .au-meter span { background: Highlight; }
}
