/* ============================================================
   CCCT / CERT PWA — App styles
   Design language: cleanroom. Filtered-light base, gowning-blue
   accent, contamination-control amber reserved strictly for warnings,
   mono for cert codes and ISO classes.
   ============================================================ */

:root {
  /* iNX corporate palette — exact values from RAS Pricing inx-brand.css */
  --inx-navy:        #15234b;  /* Midnight Navy */
  --inx-cobalt:      #253876;  /* Cobalt */
  --inx-trueblue:    #0067b0;  /* True Blue */
  --inx-green:       #54b948;  /* Clean Green */
  --inx-green-dark:  #46a23c;
  --inx-steel:       #a7a9ac;  /* Steel Gray */
  --inx-navy-card:   #1c2a5c;  /* slightly lighter for cards on dark */
  --inx-navy-input:  #0F1A38;  /* slightly darker for inputs */
  --inx-navy-line:   #2A3C6E;  /* border on dark */
  --inx-on-dark:     #E7ECF3;  /* primary text on navy */
  --inx-on-dark-2:   #A8B5C8;  /* secondary text on navy */

  /* palette */
  --ink:        #15234b;  /* unified with iNX corporate navy */
  --ink-soft:   #1c2a5c;
  --filter:     #F7F9FB;
  --filter-2:   #EDF1F5;
  --line:       #D7DEE6;
  --particle:   #5A6B7A;
  --gown:       #0067b0;  /* now True Blue */
  --gown-bright:#2479B3;
  --caution:    #E8A33D;
  --pass:       #54b948;  /* iNX Green */
  --white:      #FFFFFF;

  /* type */
  --display: "Space Grotesk", system-ui, sans-serif;
  --body:    "Inter", system-ui, -apple-system, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(12,27,42,.06), 0 8px 24px rgba(12,27,42,.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--filter);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--gown); }

/* ---- fiducial registration mark (cleanroom doc-control motif) ---- */
.fiducial {
  width: 28px; height: 28px;
  position: relative;
  flex: none;
}
.fiducial::before,
.fiducial::after {
  content: "";
  position: absolute;
  background: var(--gown);
}
.fiducial::before { left: 13px; top: 0; width: 2px; height: 28px; }
.fiducial::after  { top: 13px; left: 0; width: 28px; height: 2px; }
.fiducial span {
  position: absolute; inset: 7px;
  border: 2px solid var(--gown);
  border-radius: 50%;
}

/* ---- login ---- */
.auth-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(27,94,140,.10), transparent 60%),
    var(--filter);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--particle);
  margin: 2px 0 24px 40px;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--particle);
  margin: 16px 0 6px;
}
input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--body);
  font-size: 0.95rem;
  background: var(--filter);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus {
  outline: none;
  border-color: var(--gown);
  box-shadow: 0 0 0 3px rgba(27,94,140,.15);
  background: var(--white);
}

.btn {
  width: 100%;
  margin-top: 22px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--gown);
  color: var(--white);
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--gown-bright); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.msg {
  margin-top: 16px;
  font-size: 0.85rem;
  padding: 10px 12px;
  border-radius: 8px;
  display: none;
}
.msg.show { display: block; }
.msg.error {
  background: rgba(232,163,61,.12);
  border: 1px solid var(--caution);
  color: #8a5a14;
}

/* ---- app chrome ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--ink);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .fiducial::before,
.topbar .fiducial::after,
.topbar .fiducial span { border-color: var(--gown-bright); background: var(--gown-bright); }
.topbar .fiducial::before, .topbar .fiducial::after { background: var(--gown-bright); }
.topbar-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.topbar-spacer { flex: 1; }
.role-chip {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  color: var(--filter);
}
.link-btn {
  background: none;
  border: none;
  color: var(--filter);
  font-family: var(--body);
  font-size: 0.85rem;
  cursor: pointer;
  opacity: .85;
}
.link-btn:hover { opacity: 1; text-decoration: underline; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}
.greeting {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.greeting-sub {
  color: var(--particle);
  margin: 0 0 28px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.panel h2 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 4px;
}
.panel p { color: var(--particle); margin: 0; font-size: 0.9rem; }

.placeholder-note {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--particle);
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ============================================================
   P2 — auth alt link, admin console, tables
   ============================================================ */

.auth-alt {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--particle);
}
.auth-alt a { font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

.panel-action {
  display: inline-block;
  margin-top: 16px;
  padding: 9px 16px;
  background: var(--gown);
  color: var(--white);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.panel-action:hover { background: var(--gown-bright); }

.admin-main { max-width: 920px; }
.admin-main .panel { margin-bottom: 20px; }

/* invite form row */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 16px;
}
.field { flex: 1 1 180px; }
.field-narrow { flex: 0 0 140px; }
.field label { margin: 0 0 6px; }
select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--body);
  font-size: 0.95rem;
  background: var(--filter);
  color: var(--ink);
}
select:focus { outline: none; border-color: var(--gown); box-shadow: 0 0 0 3px rgba(27,94,140,.15); }

.btn-inline {
  width: auto;
  margin: 0;
  padding: 11px 22px;
  flex: 0 0 auto;
}

.msg.ok {
  background: rgba(46,139,111,.12);
  border: 1px solid var(--pass);
  color: #1d6b53;
}

/* tables */
.table-wrap { margin-top: 16px; overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--particle);
  font-weight: 500;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--filter-2);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }

.mono { font-family: var(--mono); font-size: 0.82rem; }

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.pill-ok { background: rgba(46,139,111,.14); color: #1d6b53; }
.pill-wait { background: rgba(232,163,61,.16); color: #8a5a14; }
.pill-you { background: var(--filter-2); color: var(--particle); }

.role-select { width: auto; min-width: 110px; padding: 7px 10px; font-size: 0.85rem; }

.link-danger {
  background: none; border: none; cursor: pointer;
  color: #b5462f; font-family: var(--body); font-size: 0.85rem; padding: 0;
}
.link-danger:hover { text-decoration: underline; }
.link-danger:disabled { opacity: .5; cursor: default; }

.saved {
  margin-left: 8px;
  font-size: 0.78rem;
  color: var(--pass);
  font-family: var(--mono);
}

.empty { color: var(--particle); font-size: 0.9rem; margin: 12px 0 0; }

.topbar a.link-btn { text-decoration: none; }

/* P2.1 — invite email status + signup info */
.info-block {
  background: var(--filter-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--particle);
  margin: 8px 0 4px;
}
.pill-fail { background: rgba(181,70,47,.14); color: #8f3a26; }
.link-btn-sm {
  background: none; border: none; cursor: pointer;
  color: var(--gown); font-family: var(--body); font-size: 0.83rem; padding: 0; font-weight: 600;
}
.link-btn-sm:hover { text-decoration: underline; }

/* ============================================================
   P3 — quiz runner, cert dashboard, lobby, program control
   ============================================================ */

.btn-mini {
  display: inline-block; padding: 9px 18px; background: var(--gown); color: #fff;
  border: none; border-radius: 8px; font-family: var(--body); font-weight: 600;
  font-size: 0.88rem; cursor: pointer; text-decoration: none;
}
.btn-mini:hover { background: var(--gown-bright); }
.btn-mini:disabled { opacity: .6; cursor: default; }
.btn-ghost {
  padding: 9px 18px; background: none; color: var(--particle); border: 1px solid var(--line);
  border-radius: 8px; font-family: var(--body); font-weight: 600; font-size: 0.88rem; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--gown); color: var(--gown); }
.btn-submit { background: var(--pass); }
.btn-submit:hover { background: #25745c; }

/* cert dashboard */
.cert-rows { margin-top: 8px; }
.cert-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--filter-2);
}
.cert-row:last-child { border-bottom: none; }
.cert-num {
  flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-family: var(--mono); font-size: 0.82rem; font-weight: 500;
}
.cert-info { flex: 1; min-width: 0; }
.cert-title { font-weight: 600; font-size: 0.96rem; }
.cert-meta { color: var(--particle); font-size: 0.82rem; margin-top: 2px; }
.cert-action { flex: none; }

/* quiz */
.quiz-main { max-width: 680px; }
.timer { font-family: var(--mono); font-size: 0.95rem; color: var(--filter); letter-spacing: 0.04em; }
.timer-low { color: #ffd27a; }
.q-progress { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--particle); margin-bottom: 10px; }
.q-text { font-size: 1.15rem; font-weight: 500; line-height: 1.45; margin-bottom: 22px; }
.q-choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--filter);
  cursor: pointer; font-family: var(--body); font-size: 0.96rem; color: var(--ink); transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--gown); }
.choice-sel { border-color: var(--gown); background: rgba(27,94,140,.07); box-shadow: 0 0 0 2px rgba(27,94,140,.15) inset; }
.choice-letter {
  flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-family: var(--mono); font-size: 0.78rem;
}
.choice-sel .choice-letter { background: var(--gown); }
.choice-text { flex: 1; }
.q-nav { display: flex; gap: 10px; margin-top: 26px; align-items: center; }
.q-nav .btn-mini, .q-nav .btn-submit { margin-left: auto; }
.q-nav .btn-ghost + * { margin-left: auto; }

/* lobby */
.lobby-card, .lobby-pulse { margin-top: 14px; }
.lobby-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; background: rgba(27,94,140,.08); border: 1px solid var(--gown); border-radius: 10px; margin-bottom: 20px;
}
.lobby-pulse { display: flex; gap: 8px; }
.lobby-pulse span {
  width: 10px; height: 10px; border-radius: 50%; background: var(--gown); opacity: .35;
  animation: pulse 1.2s infinite ease-in-out;
}
.lobby-pulse span:nth-child(2){ animation-delay: .2s; }
.lobby-pulse span:nth-child(3){ animation-delay: .4s; }
@keyframes pulse { 0%,100%{ opacity:.25; transform:scale(.85);} 50%{ opacity:1; transform:scale(1.1);} }

/* program control */
.control-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--filter-2); }
.control-block:first-of-type { border-top: none; padding-top: 8px; }
.control-block h3 { font-family: var(--display); font-size: 0.92rem; margin: 0 0 12px; }
.release-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.release-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.release-item.on { border-color: var(--pass); background: rgba(46,139,111,.05); }
.release-item.locked { border-color: var(--ink); background: rgba(12,27,42,.04); }
.release-label { font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.release-n { font-family: var(--mono); font-size: 0.72rem; color: var(--particle); min-width: 30px; }
.release-hint { flex-basis: 100%; font-family: var(--mono); font-size: 0.7rem; color: var(--particle); margin-top: 2px; }
.toggle { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--filter);
  font-family: var(--body); font-size: 0.8rem; font-weight: 600; color: var(--particle); cursor: pointer; }
.toggle-on { background: var(--pass); color: #fff; border-color: var(--pass); }
.toggle-locked { background: var(--ink); color: #fff; border-color: var(--ink); cursor: not-allowed; opacity: 0.85; }
.toggle-gated { background: var(--filter); color: var(--particle); border-color: var(--line); cursor: not-allowed; opacity: 0.65; }
.toggle[disabled] { cursor: not-allowed; }
.retake-row { display: flex; align-items: center; gap: 14px; }
.state-open { color: var(--pass); font-weight: 600; }
.state-closed { color: var(--particle); }
.session-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--filter-2); }
.session-row:last-child { border-bottom: none; }

/* ============================================================
   iNX Corporate Branding — auth banner, dark theme, topbar v2
   Login/Signup/Reset page banner with green underline + warning box.
   Topbar: white wordmark + mono subtitle + green underline.
   ============================================================ */

/* --- auth-body: dark navy theme on login/signup/reset --- */
body.auth-body {
  background: var(--inx-navy);
  color: var(--inx-on-dark);
  min-height: 100dvh;
}

.auth-banner {
  background: var(--inx-navy);
  padding: 18px 28px 0;
  border-bottom: 3px solid var(--inx-green);
}
.auth-banner-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 16px;
}
.auth-banner-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}
.fiducial-white::before,
.fiducial-white::after {
  background: #fff !important;
}
.fiducial-white span {
  border-color: #fff !important;
  background: transparent !important;
}
.auth-banner-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}
.auth-banner-subtitle {
  display: block;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,.65);
  margin-top: 2px;
}
.auth-warning-box {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: right;
  color: var(--inx-green);
  border: 1px solid var(--inx-green);
  padding: 6px 12px;
  border-radius: 3px;
  line-height: 1.55;
}
@media (max-width: 640px) {
  .auth-banner { padding: 14px 16px 0; }
  .auth-banner-inner { gap: 12px; padding-bottom: 12px; }
  .auth-banner-title { font-size: 0.9rem; }
  .auth-banner-subtitle { font-size: 0.55rem; }
  .auth-warning-box { font-size: 0.58rem; padding: 4px 8px; }
}

/* --- override .auth-wrap + .auth-card on dark body --- */
.auth-body .auth-wrap {
  background: transparent;
  min-height: calc(100dvh - 92px);
  padding-top: 28px;
}
.auth-body .auth-card {
  background: var(--inx-navy-card);
  border: 1px solid var(--inx-navy-line);
  color: var(--inx-on-dark);
  box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 12px 32px rgba(0,0,0,.35);
}
.auth-body .brand-name { color: #fff; }
.auth-body .brand-sub {
  color: var(--inx-green);
  margin-left: 0;
}
.auth-body label {
  color: var(--inx-on-dark);
}
.auth-body input[type="email"],
.auth-body input[type="password"],
.auth-body input[type="text"] {
  background: var(--inx-navy-input);
  border-color: var(--inx-navy-line);
  color: #fff;
}
.auth-body input::placeholder { color: rgba(231,236,243,.4); }
.auth-body input:focus {
  border-color: var(--inx-green);
  box-shadow: 0 0 0 3px rgba(166,206,57,.22);
  background: var(--inx-navy-input);
}
.auth-body .btn {
  background: var(--inx-green);
  color: var(--inx-navy);
}
.auth-body .btn:hover { background: var(--inx-green-dark); }
.auth-body .msg.error {
  background: rgba(232,163,61,.18);
  border-color: var(--caution);
  color: #ffd989;
}
.auth-body .msg.ok {
  background: rgba(166,206,57,.15);
  border-color: var(--inx-green);
  color: var(--inx-green);
}
.auth-body .auth-alt { color: var(--inx-on-dark-2); }
.auth-body .auth-alt a,
.auth-body .link-btn-sm {
  color: var(--inx-green);
}
.auth-body .info-block {
  background: rgba(166,206,57,.08);
  border-color: var(--inx-navy-line);
  color: var(--inx-on-dark-2);
}

/* --- password show/hide toggle --- */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: rgba(231,236,243,.55);
  font-size: 1rem;
  padding: 0;
  border-radius: 4px;
}
.pw-toggle:hover { color: var(--inx-green); background: rgba(255,255,255,.04); }
.pw-toggle:focus-visible {
  outline: 2px solid var(--inx-green);
  outline-offset: 1px;
}
.pw-toggle svg { width: 18px; height: 18px; display: block; }

/* --- auth-row: remember-me + forgot link --- */
.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--inx-on-dark);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--inx-green);
  cursor: pointer;
  margin: 0;
}
.auth-body .link-btn-sm {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--inx-green);
}
.auth-body .link-btn-sm:hover { text-decoration: underline; }
.auth-body .link-btn-sm:disabled { opacity: 0.6; cursor: default; }

/* --- forgot panel --- */
.auth-card-forgot h2 {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: #fff;
}
.auth-card-forgot p {
  color: var(--inx-on-dark-2);
  font-size: 0.9rem;
  margin: 0 0 8px;
}
.auth-back-row {
  text-align: center;
  margin-top: 14px;
}

/* --- in-app topbar v2: subtitle + green underline + white fiducial --- */
.topbar {
  background: var(--inx-navy);
  border-bottom: 2px solid var(--inx-green);
}
.topbar .fiducial::before,
.topbar .fiducial::after {
  background: #fff !important;
}
.topbar .fiducial span {
  border-color: #fff !important;
  background: transparent !important;
}
.topbar-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.topbar-stack .topbar-title {
  color: #fff;
  line-height: 1.1;
}
.topbar-subtitle {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 560px) {
  .topbar-subtitle { font-size: 0.52rem; }
}

/* ============================================================
   v2 corrections — iNX logo, 3-col header, white sign-in button,
   dark-mode in-app pages, Google sign-in button, idle banner
   ============================================================ */

/* --- iNX logo (image, replaces fiducial on real branded pages) --- */
.inx-logo {
  display: inline-block;
  width: 86px;
  height: 38px;
  background: url("/assets/inx/inx-logo-color.png") left center / contain no-repeat;
  flex-shrink: 0;
}
@media (max-width: 560px) {
  .inx-logo { width: 64px; height: 28px; }
}

/* --- 3-column auth banner: logo | centered title | warning box --- */
.auth-banner-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 16px;
}
.auth-banner-left {
  justify-self: start;
  display: flex;
  align-items: center;
}
.auth-banner-center {
  justify-self: center;
  text-align: center;
  min-width: 0;
}
.auth-banner-center .auth-banner-title { display: block; color: #fff; }
.auth-banner-center .auth-banner-subtitle { color: rgba(255,255,255,.7); }
.auth-banner-right {
  justify-self: end;
}
@media (max-width: 720px) {
  .auth-banner-inner {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 8px 14px;
  }
  .auth-banner-left { grid-row: 1; grid-column: 1; }
  .auth-banner-right { grid-row: 1; grid-column: 2; justify-self: end; }
  .auth-banner-center {
    grid-row: 2; grid-column: 1 / -1;
    justify-self: center;
    text-align: center;
  }
}

/* --- white sign-in button override on dark auth body --- */
.auth-body .btn-primary-white {
  background: #fff;
  color: var(--inx-navy);
  border: 1px solid #fff;
}
.auth-body .btn-primary-white:hover {
  background: #f0f4f8;
  border-color: #f0f4f8;
}

/* --- Google sign-in button --- */
.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
}
.btn-google:hover {
  background: #f8f9fa;
  border-color: #c8cdd4;
}
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-google-text { font-family: var(--body); font-weight: 500; }

/* --- "OR" divider between password form and Google button --- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: rgba(231,236,243,.5);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--mono);
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--inx-navy-line);
}

/* --- in-app dark mode (home, certs, admin, quiz) --- */
body.app-body {
  background: var(--inx-navy);
  color: var(--inx-on-dark);
  min-height: 100dvh;
}
body.app-body main { color: var(--inx-on-dark); }
body.app-body .greeting,
body.app-body h1, body.app-body h2, body.app-body h3 { color: #fff; }
body.app-body .greeting-sub,
body.app-body p,
body.app-body .empty,
body.app-body .helper { color: var(--inx-on-dark-2); }

/* Topbar v3: now uses iNX logo + 3-col layout (logo left, title center, controls right) */
.topbar {
  background: var(--inx-navy);
  border-bottom: 2px solid var(--inx-green);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
}
.topbar-left { justify-self: start; display: flex; align-items: center; }
.topbar-center { justify-self: center; text-align: center; min-width: 0; }
.topbar-right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.topbar-center .topbar-title { color: #fff; line-height: 1.1; }
.topbar-center .topbar-subtitle { color: rgba(255,255,255,.6); margin-top: 3px; }
@media (max-width: 560px) {
  .topbar {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    padding: 10px 14px;
  }
  .topbar-left { grid-row: 1; grid-column: 1; }
  .topbar-right { grid-row: 1; grid-column: 2; }
  .topbar-center { grid-row: 2; grid-column: 1 / -1; }
}

/* Buttons & links inside the dark topbar */
body.app-body .link-btn,
body.app-body .role-chip {
  color: var(--inx-on-dark);
}
body.app-body .role-chip {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
}

/* Cards / panels in app body */
body.app-body .panel,
body.app-body .cert-card,
body.app-body .lobby-card,
body.app-body .qa-card,
body.app-body .cert-row,
body.app-body .info-block {
  background: var(--inx-navy-card);
  border-color: var(--inx-navy-line);
  color: var(--inx-on-dark);
}
body.app-body .cert-row .meta,
body.app-body .cert-card .meta {
  color: var(--inx-on-dark-2);
}

/* Inputs / forms in app body */
body.app-body input[type="email"],
body.app-body input[type="password"],
body.app-body input[type="text"],
body.app-body select,
body.app-body textarea {
  background: var(--inx-navy-input);
  border-color: var(--inx-navy-line);
  color: #fff;
}
body.app-body input:focus,
body.app-body select:focus,
body.app-body textarea:focus {
  border-color: var(--inx-green);
  box-shadow: 0 0 0 3px rgba(84,185,72,.22);
}
body.app-body label { color: var(--inx-on-dark); }

/* Buttons in app body: green primary */
body.app-body .btn { background: var(--inx-green); color: #fff; border-color: var(--inx-green); }
body.app-body .btn:hover { background: var(--inx-green-dark); }
body.app-body .btn-secondary {
  background: transparent;
  color: var(--inx-on-dark);
  border: 1px solid var(--inx-navy-line);
}
body.app-body .btn-secondary:hover {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.25);
}

/* Quiz screen specific dark theme */
body.app-body .quiz-main { background: transparent; }
body.app-body .question-card {
  background: var(--inx-navy-card);
  border-color: var(--inx-navy-line);
  color: var(--inx-on-dark);
}
body.app-body .choice {
  background: var(--inx-navy-input);
  border-color: var(--inx-navy-line);
  color: var(--inx-on-dark);
}
body.app-body .choice:hover { border-color: rgba(255,255,255,.3); }
body.app-body .choice.selected,
body.app-body .choice[aria-checked="true"] {
  background: rgba(84,185,72,.18);
  border-color: var(--inx-green);
  color: #fff;
}
body.app-body .timer {
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--mono);
}
body.app-body .timer.warn { color: var(--caution); border-color: var(--caution); }

/* Admin console dark mode (preserves contrast on tables & tabs) */
body.app-body .admin-tabs button {
  color: var(--inx-on-dark-2);
  background: transparent;
  border-color: var(--inx-navy-line);
}
body.app-body .admin-tabs button.active {
  background: var(--inx-green);
  color: #fff;
  border-color: var(--inx-green);
}
body.app-body table {
  color: var(--inx-on-dark);
  border-color: var(--inx-navy-line);
}
body.app-body th { background: var(--inx-navy-card); color: var(--inx-on-dark); }
body.app-body td { border-color: var(--inx-navy-line); }

/* Idle-logout banner on login (shown when ?reason=idle) */
.idle-banner {
  max-width: 420px;
  margin: 0 auto 14px;
  padding: 12px 16px;
  background: rgba(232,163,61,.15);
  border: 1px solid var(--caution);
  border-radius: 8px;
  color: #ffd989;
  font-size: 0.85rem;
  text-align: center;
}

/* ============================================================
   v3 — RAS-style sign-in: big iNX logo, no warning box, big title,
   green primary button, white Google button, card with green
   left accent + green serif heading, no "OR" divider, footer ver.
   ============================================================ */

/* Bigger iNX logo for auth pages (RAS-matched size) */
.auth-body .inx-logo {
  width: 168px;
  height: 70px;
}
@media (max-width: 640px) {
  .auth-body .inx-logo { width: 124px; height: 52px; }
}
@media (max-width: 420px) {
  .auth-body .inx-logo { width: 100px; height: 42px; }
}

/* 2-col banner: iNX logo left, brand + title right (no warning box column) */
.auth-body .auth-banner-inner {
  grid-template-columns: auto 1fr;
  gap: 24px;
  padding-bottom: 14px;
  align-items: center;
}
.auth-body .auth-banner-left {
  justify-self: start;
}
.auth-body .auth-banner-center {
  justify-self: start;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
/* Make the fiducial appear next to the big title */
.auth-body .auth-banner-center .fiducial {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}
.auth-body .auth-banner-center .fiducial::before { left: 15px; height: 32px; }
.auth-body .auth-banner-center .fiducial::after  { top: 15px; width: 32px; }

/* Hide right column entirely (warning box) */
.auth-body .auth-banner-right { display: none !important; }

/* Big title — RAS scale */
.auth-body .auth-banner-title {
  font-size: 1.55rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  line-height: 1.05;
}
.auth-body .auth-banner-subtitle {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  margin-top: 4px;
}
@media (max-width: 640px) {
  .auth-body .auth-banner-title { font-size: 1.15rem; }
  .auth-body .auth-banner-subtitle { font-size: 0.6rem; }
  .auth-body .auth-banner-center .fiducial { width: 24px; height: 24px; }
  .auth-body .auth-banner-center .fiducial::before { left: 11px; height: 24px; }
  .auth-body .auth-banner-center .fiducial::after  { top: 11px; width: 24px; }
}
@media (max-width: 420px) {
  .auth-body .auth-banner-title { font-size: 1rem; letter-spacing: 0.04em; }
  .auth-body .auth-banner-subtitle { font-size: 0.55rem; }
}

/* Auth card with green left-edge accent (RAS-matched) */
.auth-body .auth-card {
  border-left: 4px solid var(--inx-green);
  padding-left: 28px;
  padding-top: 26px;
}

/* Green serif-style greeting heading inside the card */
.auth-body .auth-card-greeting {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0;
  color: var(--inx-green);
  margin: 0 0 22px;
  line-height: 1.1;
}

/* Labels: GREEN UPPERCASE (matches RAS) */
.auth-body label {
  color: var(--inx-green);
  font-size: 0.72rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 6px;
}

/* Remember-me label uppercase too */
.auth-body .checkbox-row {
  font-size: 0.72rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(231,236,243,.7);
}
.auth-body .checkbox-row input {
  width: 18px;
  height: 18px;
  border: 1px solid var(--inx-green);
}

/* Sign-in button BACK to green (large + bold like RAS) */
.auth-body .btn {
  background: var(--inx-green);
  color: #fff;
  border: 1px solid var(--inx-green);
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 14px 16px;
  font-size: 0.95rem;
  /* RAS-matched text outline for legibility on solid green */
  -webkit-text-stroke: 1px #265316;
  paint-order: stroke fill;
}
.auth-body .btn:hover {
  background: var(--inx-green-dark);
  border-color: var(--inx-green-dark);
}

/* (Old white-button class kept as no-op so existing markup still works) */
.auth-body .btn-primary-white {
  background: var(--inx-green);
  color: #fff;
  border-color: var(--inx-green);
}
.auth-body .btn-primary-white:hover {
  background: var(--inx-green-dark);
  border-color: var(--inx-green-dark);
}

/* Google button — white, NO text-stroke (only solid-green buttons get the stroke) */
.auth-body .btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  -webkit-text-stroke: 0;
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 600;
  margin-top: 12px;
}
.auth-body .btn-google:hover {
  background: #f3f5f8;
  border-color: #c8cdd4;
}
.auth-body .btn-google-text {
  -webkit-text-stroke: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Hide the OR divider — per Jim's spec, buttons stack directly */
.auth-body .auth-divider { display: none; }

/* Move forgot-password link below buttons (RAS layout) */
.auth-body .auth-row {
  margin-top: 16px;
}

/* Subtle version footer (bottom-left, mono) */
.auth-footer-ver {
  position: fixed;
  left: 18px;
  bottom: 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(231,236,243,.45);
  pointer-events: none;
}
@media (max-width: 640px) {
  .auth-footer-ver { font-size: 0.65rem; left: 14px; bottom: 10px; }
}

/* ============================================================
   v4 — Header refinement: thicker/larger fiducial, bigger title,
   vertical-align fix (push header down to match iNX optical center)
   ============================================================ */

/* Larger, BOLDER fiducial alongside the CCCT title — overrides v3 sizes */
.auth-body .auth-banner-center .fiducial {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
}
.auth-body .auth-banner-center .fiducial::before {
  left: 21px;
  top: 0;
  width: 4px;
  height: 46px;
}
.auth-body .auth-banner-center .fiducial::after {
  top: 21px;
  left: 0;
  width: 46px;
  height: 4px;
}
.auth-body .auth-banner-center .fiducial span {
  /* Reset inset from base rule so the explicit width/height re-centers the
     circle inside the 46×46 container. Base rule's inset:7px was anchoring
     the circle's top-left at (7,7) → center (17,17), which is 6px off-center
     against the crosshair centers at (23,23). For a 20×20 circle in a 46×46
     box, inset = (46-20)/2 = 13px. */
  inset: 13px;
  width: 20px;
  height: 20px;
  border-width: 2.5px;
}
@media (max-width: 640px) {
  .auth-body .auth-banner-center .fiducial { width: 34px; height: 34px; }
  .auth-body .auth-banner-center .fiducial::before { left: 15px; height: 34px; width: 3px; }
  .auth-body .auth-banner-center .fiducial::after  { top: 15px; width: 34px; height: 3px; }
  /* (34-14)/2 = 10 — keep the 14×14 circle centered on the crosshair. */
  .auth-body .auth-banner-center .fiducial span { inset: 10px; width: 14px; height: 14px; border-width: 2px; }
}

/* Bigger title — gives more visual weight, pushes whole block lower */
.auth-body .auth-banner-title {
  font-size: 1.85rem;
  letter-spacing: 0.05em;
}
@media (max-width: 640px) {
  .auth-body .auth-banner-title { font-size: 1.25rem; }
}
@media (max-width: 420px) {
  .auth-body .auth-banner-title { font-size: 1.05rem; letter-spacing: 0.03em; }
}

/* Push the header text down to optically align with the "iNX" letters
   in the logo (which sit in the lower-middle of the logo image — the
   swoosh raises the geometric center higher than the optical center). */
.auth-body .auth-banner-inner {
  padding-bottom: 18px;
  padding-top: 8px;
  align-items: end;
}
.auth-body .auth-banner-left {
  align-self: end;
}
.auth-body .auth-banner-center {
  align-self: end;
  padding-bottom: 2px;
}

/* ════════════════════════════════════════════════════════════════════════
   v13 — Language toggle (EN/ES)
   ════════════════════════════════════════════════════════════════════════
   The <head> bootstrap script adds html.lang-en or html.lang-es from
   localStorage BEFORE first paint. CSS then hides whichever spans don't
   match. Static text wraps as:
     <span class="en">Sign out</span><span class="es">Cerrar sesión</span>
*/

html.lang-en .es { display: none !important; }
html.lang-es .en { display: none !important; }

/* The toggle itself — pill of two buttons, iNX-themed.
   Works on both the dark auth banner and the dark in-app topbar. */
.lang-toggle {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
  height: 26px;
  margin-right: 6px;
  vertical-align: middle;
}
.lang-btn {
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  border: 0;
  padding: 0 11px;
  font-family: var(--display, "Space Grotesk", system-ui, sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  line-height: 1;
}
.lang-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.lang-btn-active,
.lang-btn-active:hover {
  background: var(--inx-green, #54b948);
  color: #fff;
  cursor: default;
}
.lang-btn:focus-visible {
  outline: 2px solid var(--inx-green, #54b948);
  outline-offset: 2px;
}

/* Auth pages — sit the toggle below the version footer area, top-right of banner.
   Anchored inside the auth-banner so it tracks the dark header. */
.auth-banner-inner .lang-toggle {
  position: absolute;
  top: 14px;
  right: 18px;
}
@media (max-width: 640px) {
  .auth-banner-inner .lang-toggle { top: 10px; right: 12px; height: 24px; }
  .lang-btn { font-size: 0.65rem; padding: 0 9px; }
}
