/* PEpracticehub - shared primitives.
   Reset, typography, buttons, form controls, alerts. Loaded after tokens.css
   by every page that is not one of the two legacy marketing pages. */

*{box-sizing:border-box}

/* Class selectors below tie with the browser's own [hidden] rule and win on
   source order, so anything using the hidden attribute needs this. */
[hidden]{display:none !important}

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--body);
  font-size:16px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--blue-text)}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--amber);outline-offset:3px;border-radius:8px}
h1,h2,h3{font-family:var(--display);margin:0;line-height:1;text-transform:uppercase;text-wrap:balance}
p{margin:0}
img{max-width:100%}

/* Visible to screen readers, invisible on screen. Uses clipping rather than
   an off-screen position, which can drag the page sideways on small widths. */
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);
  white-space:nowrap;border:0;
}

/* buttons */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:9px;
  padding:14px 20px;border-radius:10px;border:1.5px solid transparent;
  font-weight:600;font-size:15px;cursor:pointer;text-decoration:none;
  transition:transform .16s,box-shadow .16s,opacity .16s;
}
.btn:hover:not(:disabled){transform:translateY(-1px)}
.btn:disabled{opacity:.55;cursor:not-allowed;transform:none}
.btn-amber{background:var(--amber);color:var(--amber-ink);box-shadow:0 10px 24px -12px rgba(245,165,36,.85)}
.btn-blue{background:var(--blue-deep);color:#fff}
.btn-ghost{background:var(--surface);border-color:var(--line);color:var(--ink)}
.btn-wide{width:100%}

/* form controls */
form{display:grid;gap:17px}
.field{display:grid;gap:6px}
.field>label{font-size:13px;font-weight:600}
.field .hint{font-size:12.5px;color:var(--muted)}
/* An explicit height, because a date field carries a native calendar button
   and a select carries a native arrow, and each renders a few pixels taller
   than a plain text box. Side by side that reads as a mistake. */
input[type=text],input[type=email],input[type=password],input[type=date],select{
  width:100%;height:50px;padding:13px 15px;line-height:1.3;
  border:1.5px solid var(--line);border-radius:10px;
  background:var(--bg);transition:border-color .15s,box-shadow .15s;
}
/* A textarea sets its own height from the rows attribute, so it is kept out
   of the rule above rather than fighting it. */
textarea{
  width:100%;padding:13px 15px;line-height:1.55;resize:vertical;
  border:1.5px solid var(--line);border-radius:10px;
  background:var(--bg);transition:border-color .15s,box-shadow .15s;
}
input:focus,select:focus,textarea:focus{
  outline:none;border-color:var(--blue);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--blue) 16%,transparent);
}
.field.bad input,.field.bad select,.field.bad textarea{border-color:var(--bad)}
.field .err{font-size:12.5px;color:var(--bad);display:none}
.field.bad .err{display:block}

.check{display:flex;gap:11px;align-items:flex-start;font-size:13.5px;color:var(--muted);line-height:1.45}
.check input{margin-top:2px;width:17px;height:17px;flex:none;accent-color:var(--amber)}
@media (pointer:coarse){.check input{width:22px;height:22px;margin-top:0}}
.check.bad{color:var(--bad)}

/* alerts */
.alert{padding:13px 15px;border-radius:10px;font-size:14px;display:none;line-height:1.45}
.alert.show{display:block}
.alert.error{background:color-mix(in srgb,var(--bad) 12%,transparent);border-left:3px solid var(--bad)}
.alert.good{background:color-mix(in srgb,var(--ok) 12%,transparent);border-left:3px solid var(--ok)}
.alert b{display:block;margin-bottom:2px}

.divider{
  display:flex;align-items:center;gap:12px;color:var(--muted);font-size:12px;
  font-family:var(--mono);text-transform:uppercase;letter-spacing:.1em;margin:2px 0;
}
.divider::before,.divider::after{content:"";height:1px;background:var(--line);flex:1}

/* ---------- figures: tap to see full size ----------
   Used by /practice/, /account/history/ and the admin preview, with
   assets/js/figure-zoom.js. The label under each figure says it can be
   opened, because nothing else about a picture does. */
.q-figure img,.sol-figure img,.hbody figure img{cursor:zoom-in}
.q-figure::after,.sol-figure::after,.hbody figure::after{
  content:"Tap the picture to see it full size";
  font-size:12px;color:var(--muted);
}
html.zoom-open{overflow:hidden}
.zoom{position:fixed;inset:0;z-index:1000;background:rgba(8,12,24,.94);
  display:grid;grid-template-rows:auto minmax(0,1fr)}
.zoom[hidden]{display:none}
.zoom-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px}
.zoom-hint{font-size:14px;color:#C6D2F2}
.zoom-close{min-height:44px;padding:0 20px;border-radius:10px;border:1px solid rgba(255,255,255,.35);
  background:rgba(255,255,255,.1);color:#fff;font:inherit;font-weight:600;cursor:pointer}
.zoom-close:focus-visible{outline:3px solid #F5A524;outline-offset:2px}
.zoom-stage{overflow:auto;display:grid;place-items:center;padding:12px;overscroll-behavior:contain}
.zoom-stage img{display:block;max-width:100%;max-height:calc(100dvh - 92px);width:auto;height:auto;
  background:#fff;border-radius:8px;cursor:zoom-in}
.zoom.zoomed .zoom-stage{place-items:start}
.zoom.zoomed .zoom-stage img{max-width:none;max-height:none;cursor:zoom-out}
