/* Account pages (account.html) — black and white only, split screen: logo left, form right.
   Also holds the inactivity-warning box, which the main app uses too. */

/* ---------------- account pages ---------------- */
.account-page {
  --ink: #000; --ink-soft: #4a4a4a; --line: #000; --muted-line: #c8c8c8; --paper: #fff;
  color-scheme: light;
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: 'Noto Sans', 'Noto Sans Sinhala', system-ui, sans-serif; line-height: 1.45;
}
.account-page * { box-sizing: border-box; }
.account-page .si { display: block; font-family: 'Noto Sans Sinhala', 'Noto Sans', system-ui, sans-serif; font-size: 0.78em; font-weight: 500; color: var(--ink-soft); margin-top: 1px; }
.account-page a { color: var(--ink); text-underline-offset: 2px; }
.account-page a .si, .account-page button .si { display: block; }

.auth-split { display: flex; min-height: 100vh; min-height: 100dvh; }
.auth-brand {
  flex: 1 1 50%; display: flex; align-items: center; justify-content: center;
  background: #fff; border-right: 1px solid var(--line); padding: 40px;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
}
.auth-brand img { width: min(440px, 80%); height: auto; }
.auth-panel {
  flex: 1 1 50%; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 48px 32px 24px;
}
.auth-inner { width: 100%; max-width: 420px; outline: none; }
.auth-legal { margin-top: 32px; font-size: 0.75rem; color: var(--ink-soft); }
.auth-legal a { color: var(--ink-soft); }

.auth-title { font-size: 1.6rem; font-weight: 700; margin: 0 0 20px; letter-spacing: 0.2px; }
.auth-title .si { font-size: 0.62em; margin-top: 4px; }
.auth-sub { font-size: 1.05rem; font-weight: 700; margin: 28px 0 10px; padding-top: 18px; border-top: 1px solid var(--muted-line); }
.auth-text { font-size: 0.92rem; margin: 0 0 16px; }
.auth-hint { font-size: 0.78rem; color: var(--ink-soft); margin: 6px 0 0; }
.auth-loading { color: var(--ink-soft); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.auth-field input, .auth-pw {
  width: 100%; font: inherit; font-size: 0.95rem; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 6px;
}
.auth-field input { padding: 10px 12px; }
.auth-field input:focus-visible, .auth-pw:focus-within { outline: 2px solid #000; outline-offset: 2px; }
.auth-pw { display: flex; align-items: stretch; }
.auth-pw input { border: none; flex: 1; min-width: 0; padding: 10px 12px; border-radius: 6px; outline: none; background: transparent; }
.auth-pw input:focus-visible { outline: none; }
.auth-peek { border: none; border-left: 1px solid var(--muted-line); background: #fff; font: inherit; font-size: 0.78rem; font-weight: 600; padding: 0 12px; cursor: pointer; border-radius: 0 6px 6px 0; color: var(--ink); }
.auth-static { font-size: 0.95rem; padding: 10px 12px; border: 1px dashed var(--muted-line); border-radius: 6px; word-break: break-all; }

.auth-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; font-size: 0.85rem; }
.auth-check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.85rem; cursor: pointer; }
.auth-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: #000; flex: none; }
.auth-check.terms { font-size: 0.82rem; }

.auth-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  width: 100%; font: inherit; font-size: 0.95rem; font-weight: 700; padding: 11px 16px; min-height: 48px;
  background: #000; color: #fff; border: 1px solid #000; border-radius: 6px; cursor: pointer;
}
.auth-btn .si { color: rgba(255,255,255,0.8); font-size: 0.72rem; }
.auth-btn:hover { background: #222; }
.auth-btn:focus-visible { outline: 2px solid #000; outline-offset: 3px; }
.auth-btn.secondary { background: #fff; color: #000; flex-direction: row; gap: 12px; }
.auth-btn.secondary .si { color: var(--ink-soft); }
.auth-btn.secondary:hover { background: #f2f2f2; }
.auth-btn.busy, .auth-btn:disabled { opacity: 0.55; cursor: progress; }
.auth-btn + .auth-btn, .auth-msg + .auth-btn { margin-top: 0; }
.g-mark { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1.5px solid #000; border-radius: 50%; font-weight: 700; font-size: 0.85rem; flex: none; }
.auth-link-btn { background: none; border: none; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; display: inline; }
.auth-link-btn .si { display: inline; margin-left: 6px; }

.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-soft); font-size: 0.78rem; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--muted-line); }
.auth-foot { margin: 20px 0 0; font-size: 0.88rem; text-align: center; }
.auth-foot a .si { display: inline; margin-left: 6px; }

.auth-msg:empty { display: none; }
.auth-msg { font-size: 0.86rem; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); }
.auth-msg.err { border-width: 2px; font-weight: 600; }
.auth-msg.ok { border-style: solid; background: #f2f2f2; }
.auth-msg.info { border-style: dashed; }
.auth-inner > .auth-msg { margin-bottom: 16px; }

.auth-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 0.78rem; }
.auth-rules li { position: relative; padding-left: 22px; color: var(--ink-soft); }
.auth-rules li .si { display: inline; margin-left: 6px; font-size: 0.95em; }
.auth-rules li::before { content: '○'; position: absolute; left: 2px; top: 0; }
.auth-rules li.ok { color: #000; font-weight: 600; }
.auth-rules li.ok::before { content: '✓'; }

.auth-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.auth-card-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--muted-line); font-size: 0.88rem; }
.auth-card-row:last-of-type { border-bottom: none; }
.auth-card-row span { color: var(--ink-soft); }
.auth-card-row strong { text-align: right; }
.auth-card .auth-text { margin: 10px 0 0; }
.auth-qr { display: flex; justify-content: center; margin: 4px 0 8px; }
.auth-qr img { border: 1px solid var(--line); padding: 8px; background: #fff; }
.auth-hint code { word-break: break-all; font-size: 0.85rem; color: #000; }

/* My profile › Find a counsellor card (black and white: warn = heavier edge, note in a boxed line) */
.pf-card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; }
.pf-card-title .si { display: inline; margin-left: 6px; }
.pf-state { font-size: 0.86rem; margin: 0 0 10px; padding: 2px 0 2px 10px; border-left: 3px solid var(--muted-line); }
.pf-state.ok { border-left-color: #000; }
.pf-state.warn { border-left: 5px solid #000; }
.pf-note { font-size: 0.86rem; border: 2px solid #000; border-radius: 6px; padding: 8px 10px; margin: 0 0 10px; white-space: pre-line; overflow-wrap: anywhere; }
.account-page a.pf-listing-btn { text-decoration: none; color: #fff; }
.pf-pw-sum { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; }
.pf-pw-sum::-webkit-details-marker { display: none; }
.pf-pw-sum::before { content: '▸'; font-size: 0.9em; }
.pf-pw[open] > .pf-pw-sum::before { content: '▾'; }
.pf-pw-sum .si { display: inline; }

/* My profile on wide screens: logo 1/3 · profile + account 1/3 · Find a counsellor + password 1/3 */
@media (min-width: 1100px) {
  body.pf-wide .auth-brand { flex: 0 0 33.333%; padding: 32px; }
  body.pf-wide .auth-brand img { width: min(340px, 82%); }
  body.pf-wide .auth-panel { flex: 1 1 66.667%; justify-content: flex-start; padding: 28px 40px 14px; }
  body.pf-wide .auth-inner { max-width: 920px; }
  body.pf-wide .pf-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  body.pf-wide .auth-title { margin-bottom: 14px; }
  body.pf-wide .auth-form { gap: 10px; }
  body.pf-wide .auth-sub { margin: 16px 0 8px; padding-top: 12px; }
  body.pf-wide #pfColMore > .auth-card:first-child { margin-top: 4px; }
  body.pf-wide .auth-foot { margin-top: 14px; }
  body.pf-wide .auth-legal { margin-top: 14px; }
  body.pf-wide .auth-title .si, body.pf-wide .auth-sub .si, body.pf-wide .auth-field label .si { display: inline; margin-left: 8px; }
  body.pf-wide .auth-field label { margin-bottom: 4px; }
  body.pf-wide .auth-field input, body.pf-wide .auth-static { padding-top: 8px; padding-bottom: 8px; }
  body.pf-wide .auth-btn { min-height: 44px; padding: 8px 14px; }
  body.pf-wide .auth-card { padding: 10px 14px; margin-bottom: 10px; }
  body.pf-wide .auth-card-row { padding: 4px 0; }
}

/* Phones / narrow screens: logo on top (smaller), form below. */
@media (max-width: 820px) {
  .auth-split { flex-direction: column; min-height: 0; }
  .auth-brand { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 20px 16px; flex: none; }
  .auth-brand img { width: 160px; }
  .auth-panel { justify-content: flex-start; padding: 24px 16px 24px; flex: none; }
  .auth-title { font-size: 1.35rem; }
}

/* ---------------- inactivity warning (used on every signed-in page) ---------------- */
.idle-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.idle-backdrop[hidden] { display: none; }
.idle-box { background: #fff; color: #000; border: 2px solid #000; border-radius: 10px; max-width: 420px; width: 100%; padding: 22px 22px 18px; font-family: 'Noto Sans', 'Noto Sans Sinhala', system-ui, sans-serif; }
.idle-box h2 { margin: 0 0 10px; font-size: 1.15rem; }
.idle-box .si { display: block; font-family: 'Noto Sans Sinhala', 'Noto Sans', system-ui, sans-serif; font-size: 0.8em; font-weight: 500; color: #4a4a4a; margin-top: 2px; }
.idle-box p { font-size: 0.9rem; margin: 0 0 10px; }
.idle-note { color: #4a4a4a; font-size: 0.8rem !important; }
.idle-stay { width: 100%; font: inherit; font-weight: 700; padding: 10px; border-radius: 6px; background: #000; color: #fff; border: 1px solid #000; cursor: pointer; }
.idle-stay .si { color: rgba(255,255,255,0.8) !important; }
.account-page .auth-foot .si { display: inline; margin-left: 6px; }
