/* ShunVerified app styles (dashboard, signup, login).
   Blue and white, flat surfaces, thin borders, no gradients. */

:root {
  --ink: #102a43;          /* main text */
  --ink-2: #486581;        /* secondary text */
  --ink-3: #7b8794;        /* hints, placeholders */
  --blue: #0b78c2;         /* buttons, links (passes contrast on white) */
  --blue-hover: #0a65a3;
  --sky: #0ea5e9;          /* brand blue: focus, progress, highlights */
  --wash: #eef6fc;         /* soft blue background */
  --canvas: #f5f7fa;       /* page background */
  --paper: #ffffff;
  --line: #d9e2ec;
  --line-soft: #e8eef4;
  --ok: #0f7b45;
  --ok-wash: #e9f7ef;
  --warn: #8a5300;
  --warn-wash: #fff6e5;
  --bad: #b42318;
  --bad-wash: #fdeeed;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid rgba(14,165,233,.45); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(14,165,233,.2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .65rem 1.15rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .95rem; line-height: 1.2;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-quiet { background: transparent; color: var(--blue); padding-inline: .6rem; min-height: 36px; }
.btn-quiet:hover { background: var(--wash); }
.btn-danger { background: var(--paper); color: var(--bad); border-color: #f0c3bf; }
.btn-danger:hover { background: var(--bad-wash); }
.btn-small { min-height: 36px; padding: .4rem .8rem; font-size: .875rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { background: #e4e9ef; color: var(--ink-3); border-color: transparent; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.field .hint { font-size: .82rem; color: var(--ink-2); margin-top: .35rem; }
.input, select.input {
  width: 100%; min-height: 46px; padding: .7rem .85rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font: inherit; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: #bccad8; }
.input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(14,165,233,.18); }
.input[aria-invalid="true"] { border-color: var(--bad); }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23486581' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center;
}

/* ---------- Notices ---------- */
.notice { padding: .75rem .9rem; border-radius: var(--radius-sm); font-size: .92rem; border: 1px solid; }
.notice-info { background: var(--wash); border-color: #cfe5f6; color: #0b4f80; }
.notice-ok   { background: var(--ok-wash); border-color: #bfe5cf; color: var(--ok); }
.notice-warn { background: var(--warn-wash); border-color: #f3d9a6; color: var(--warn); }
.notice-bad  { background: var(--bad-wash); border-color: #f3c5c1; color: var(--bad); }
.notice a { color: inherit; font-weight: 600; text-decoration: underline; }

/* ---------- Panels ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; }
.panel h2 { font-size: 1.1rem; font-weight: 650; letter-spacing: -.01em; }
.panel .sub { color: var(--ink-2); font-size: .92rem; }

/* ---------- App header ---------- */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: 0 1.25rem; height: 64px; display: flex; align-items: center; gap: 2rem; }
.topbar .brand img { height: 30px; width: auto; }
.topnav { display: flex; gap: .25rem; flex: 1; }
.topnav a { color: var(--ink-2); font-weight: 500; font-size: .93rem; padding: .45rem .7rem; border-radius: 6px; }
.topnav a:hover { color: var(--ink); background: var(--canvas); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--sky); border-radius: 0; }
.topbar-end { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* ---------- Mobile tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 900px) {
  .topnav, .topbar-end .hide-mobile { display: none; }
  .topbar-inner { height: 58px; gap: 1rem; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--paper); border-top: 1px solid var(--line);
    padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: .2rem;
    padding: .3rem 0; font-size: .7rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  }
  .tabbar a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--blue); font-weight: 600; }
  body.has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}

/* ---------- Footer ---------- */
.site-foot { max-width: 1160px; margin: 0 auto; padding: 2rem 1.25rem; color: var(--ink-3); font-size: .85rem; display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-foot a { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- "?" help tips ----------
   <button type="button" class="tip" data-tip="Text shown when tapped" aria-label="More info about X">?</button>
   js/tips.js opens a small bubble on tap/click and closes it on outside tap or Esc. */
.tip {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid currentColor; background: transparent; color: var(--ink-3);
  font-size: .72rem; font-weight: 700; line-height: 1; cursor: pointer;
  vertical-align: middle; margin-left: .35rem; padding: 0;
  transition: color .15s, background-color .15s, border-color .15s;
}
.tip:hover, .tip[aria-expanded="true"] { color: #fff; background: var(--blue); border-color: var(--blue); }
.tip::before { content: ""; position: absolute; width: 40px; height: 40px; } /* bigger tap area */
.tip { position: relative; }
.tip-on-blue { color: rgba(255,255,255,.8); }
.tip-on-blue:hover, .tip-on-blue[aria-expanded="true"] { background: #fff; color: var(--blue); border-color: #fff; }
.tip-bubble {
  position: fixed; z-index: 200; max-width: 280px; width: max-content;
  background: var(--ink); color: #fff; font-size: .88rem; line-height: 1.5; font-weight: 400;
  padding: .7rem .85rem; border-radius: 10px; box-shadow: 0 10px 30px rgba(16,42,67,.25);
  opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; pointer-events: none;
}
.tip-bubble.show { opacity: 1; transform: none; pointer-events: auto; }
.tip-bubble p + p { margin-top: .4rem; }
.label-row { display: flex; align-items: center; }
.label-row label { margin-bottom: 0; }
.field .label-row { margin-bottom: .4rem; }
