/* ============================================================================
   assets/auth.css — Account pages: log in, create account (buyer/seller),
   verify code, forgot / reset password.  Markup: lib/views/auth.php
   ============================================================================
   Same palette as app.css (kept standalone so these pages stay light).
   Mobile-first; ≥ 960 px shows the green brand panel beside the form.
   ============================================================================ */
:root {
  --brand: #12A150; --brand-dk: #0B7A3B; --brand-dkr: #086130; --brand-lt: #E8F7EE;
  --ink: #1B2420; --muted: #5A665F; --line: #D5DED8; --line-lt: #E8EDEA; --bg: #F3F6F4; --card: #fff;
  --bad: #B42318; --bad-bg: #FEF3F2; --warn: #8A5A00; --ok-bg: #ECFDF3; --ok: #067647;
  --ring: 0 0 0 4px rgba(18, 161, 80, .16);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.au { margin: 0; min-height: 100vh; font: 15px/1.5 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink); background: var(--bg); }
a { color: var(--brand-dk); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---- Shell ------------------------------------------------------------------ */
.au-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.au-side { display: none; }
.au-main { display: flex; flex-direction: column; align-items: center; padding: 0 16px 28px;
  background: linear-gradient(180deg, var(--brand-dk) 0, var(--brand-dk) 150px, var(--bg) 150px); }
.au-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 22px; font-weight: 700; text-decoration: none; }
.au-brand:hover { text-decoration: none; color: #fff; }
.au-brand svg { border-radius: 10px; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.au-brand-m { margin: 22px 0 18px; max-width: 100%; }
.au-brand img { max-width: 100%; height: auto; }                 /* v28: uploaded logo never wider than a phone */
.au-card { width: 100%; max-width: 440px; background: var(--card); border-radius: 18px; padding: 24px 20px;
  box-shadow: 0 1px 2px rgba(16,40,28,.06), 0 12px 32px rgba(16,40,28,.10); }
.au-legal { margin: 18px 0 0; font-size: 13px; color: var(--muted); text-align: center; }

@media (min-width: 960px) {
  .au-shell { grid-template-columns: minmax(380px, 44%) 1fr; }
  .au-side { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 44px 48px; color: #fff;
    position: sticky; top: 0; height: 100vh;
    background:
      radial-gradient(600px 400px at 110% -10%, rgba(255,255,255,.14), transparent 60%),
      radial-gradient(500px 360px at -20% 110%, rgba(18,161,80,.55), transparent 60%),
      linear-gradient(160deg, var(--brand-dk), var(--brand-dkr)); }
  .au-pitch h2 { margin: 0 0 10px; font-size: 34px; line-height: 1.3; font-weight: 700; }
  .au-pitch p { margin: 0; font-size: 17px; opacity: .85; }
  .au-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
  .au-perks li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
    background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); }
  .au-perks svg { flex: none; margin-top: 2px; }
  .au-perks b { display: block; font-size: 15px; }
  .au-perks span { font-size: 14px; opacity: .9; }
  .au-main { justify-content: center; background: var(--bg); padding: 40px 24px; }
  .au-brand-m { display: none; }
  .au-card { padding: 32px 32px 28px; box-shadow: 0 1px 2px rgba(16,40,28,.05), 0 8px 28px rgba(16,40,28,.07); }
}

/* ---- Card heading & tabs ------------------------------------------------------ */
.au-head { margin-bottom: 18px; }
.au-head h1 { margin: 0; font-size: 24px; line-height: 1.25; }
.au-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.au-ic-badge { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-lt); color: var(--brand-dk);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.au-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 20px; background: var(--bg);
  border-radius: 12px; border: 1px solid var(--line-lt); }
.au-tabs a { text-align: center; padding: 10px 8px; border-radius: 9px; color: var(--muted); font-weight: 600; text-decoration: none; }
.au-tabs a:hover { color: var(--ink); text-decoration: none; }
.au-tabs a.on { background: var(--card); color: var(--brand-dk); box-shadow: 0 1px 3px rgba(16,40,28,.12); }

/* ---- Alerts ------------------------------------------------------------------ */
.au-alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; }
.au-alert svg { flex: none; margin-top: 1px; }
.au-alert.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid #FECDCA; }
.au-alert.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #ABEFC6; }
.au-note { display: flex; gap: 10px; padding: 11px 13px; border-radius: 12px; background: #FFFAEB; color: var(--warn); font-size: 13.5px; border: 1px solid #FEDF89; }
.au-note svg { flex: none; margin-top: 1px; }

/* ---- Fields ------------------------------------------------------------------ */
.au-form { display: flex; flex-direction: column; gap: 16px; }
.au-row2 { display: grid; gap: 16px; }
.au-field { display: flex; flex-direction: column; gap: 6px; }
.au-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.au-label label { font-size: 14px; font-weight: 600; }
.au-label a, .au-label .au-opt { font-size: 13px; }
.au-opt { color: var(--muted); font-weight: 400; }
.au-input { position: relative; display: flex; align-items: center; }
.au-input > svg { position: absolute; left: 14px; color: #8A948E; pointer-events: none; transition: color .15s; }
.au-input input { width: 100%; height: 50px; padding: 0 14px 0 44px; font: inherit; font-size: 16px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px; outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none; }
.au-input input::placeholder { color: #9AA39E; }
.au-input input:hover { border-color: #B8C4BD; }
.au-input input:focus { border-color: var(--brand); box-shadow: var(--ring); }
.au-input:focus-within > svg { color: var(--brand-dk); }
.au-field.is-invalid .au-input input { border-color: var(--bad); }
.au-field.is-invalid .au-input input:focus { box-shadow: 0 0 0 4px rgba(180,35,24,.12); }
.au-field.is-valid .au-input input { border-color: #75C69A; }
.au-pw input { padding-right: 52px; }
.au-eye { position: absolute; right: 4px; width: 44px; height: 42px; border: 0; border-radius: 10px; background: transparent;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.au-eye:hover { background: var(--bg); color: var(--ink); }
.au-eye .i-hide { display: none; }
.au-eye[aria-pressed="true"] .i-show { display: none; }
.au-eye[aria-pressed="true"] .i-hide { display: inline-flex; }
.au-eye span { display: inline-flex; }
.au-hint { color: var(--muted); font-size: 13px; }
.au-err { color: var(--bad); font-size: 13px; min-height: 0; }
.au-err:empty { display: none; }
.au-caps { display: inline-flex; align-items: center; gap: 5px; color: var(--warn); font-size: 13px; }

/* Strength meter */
.au-meter { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 5px; align-items: center; }
.au-meter i { height: 5px; border-radius: 3px; background: var(--line-lt); transition: background .2s; }
.au-meter span { font-size: 12.5px; font-weight: 600; min-width: 52px; text-align: right; color: var(--muted); }
.au-meter[data-score="1"] i:nth-child(-n+1) { background: #F04438; }
.au-meter[data-score="2"] i:nth-child(-n+2) { background: #F79009; }
.au-meter[data-score="3"] i:nth-child(-n+3) { background: #66C61C; }
.au-meter[data-score="4"] i:nth-child(-n+4) { background: var(--brand); }
.au-meter[data-score="1"] span { color: #D92D20; }
.au-meter[data-score="2"] span { color: #B54708; }
.au-meter[data-score="3"], .au-meter[data-score="4"] { }
.au-meter[data-score="4"] span, .au-meter[data-score="3"] span { color: var(--brand-dk); }

/* Account type cards (buyer / seller) */
.au-type { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.au-type legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.au-type label { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 12px 12px; border: 1.5px solid var(--line);
  border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.au-type label:hover { border-color: #B8C4BD; }
.au-type input { position: absolute; opacity: 0; pointer-events: none; }
.au-type .t-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--bg); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.au-type b { font-size: 15px; }
.au-type small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.au-type label::after { content: ''; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; }
.au-type label:has(input:checked), .au-type label.on { border-color: var(--brand); background: var(--brand-lt); }
.au-type label:has(input:checked) .t-ic, .au-type label.on .t-ic { background: #fff; color: var(--brand-dk); }
.au-type label:has(input:checked)::after, .au-type label.on::after { border: 5px solid var(--brand); }
.au-type label:has(input:focus-visible) { box-shadow: var(--ring); }

/* Check box row */
.au-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.au-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand-dk); flex: none; }

/* ---- Buttons ----------------------------------------------------------------- */
.au-btn { position: relative; width: 100%; height: 52px; border: 0; border-radius: 12px; font: inherit; font-size: 16px; font-weight: 700;
  color: #fff; background: var(--brand-dk); cursor: pointer; transition: background .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(11,122,59,.3); }
.au-btn:hover { background: var(--brand-dkr); }
.au-btn:active { transform: translateY(1px); }
.au-btn:disabled { cursor: progress; opacity: .85; }
.au-btn.is-loading { color: transparent; }
.au-btn.is-loading::after { content: ''; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: au-spin .7s linear infinite; }
@keyframes au-spin { to { transform: rotate(360deg); } }
.au-btn.ghost { background: #fff; color: var(--brand-dk); border: 1.5px solid var(--line); box-shadow: none; }
.au-btn.ghost:hover { background: var(--bg); }
.au-link { border: 0; background: none; padding: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--brand-dk); cursor: pointer; }
.au-link:hover { text-decoration: underline; }
.au-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-lt); text-align: center; font-size: 14px; color: var(--muted); }
.au-foot p { margin: 0; }
.au-split { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.au-back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; margin-bottom: 14px; }

/* ---- OTP code ---------------------------------------------------------------- */
.au-code input { height: 60px; padding: 0 10px; font-size: 28px; letter-spacing: 12px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- Success / sent state ---------------------------------------------------- */
.au-sent { text-align: center; }
.au-sent .au-ic-badge { width: 64px; height: 64px; border-radius: 50%; }
.au-sent ul { text-align: left; margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }

@media (prefers-reduced-motion: reduce) { *, *::after { transition: none !important; animation-duration: 1.5s !important; } }
