/* ═══════════════════════════════════════════════════════════════
   AUTHENTICATION ARCHITECTURE — Page Styles
   Master cryptographic-verification page for the entire site.
   Reuses /internet-archive/ + /database/ component conventions.
   ═══════════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:          #0c0c12;
  --surface:     #111119;
  --card:        #161622;
  --elevated:    #1c1c2a;
  --border:      #2a2a3c;
  --border-dim:  #3a3a50;
  --text:        #cdc8d4;
  --text-bright: #e8e6e1;
  --text-white:  #ffffff;
  --text-dim:    #a0a0a0;
  --text-muted:  #707070;
  --red:         #ff5545;
  --gold:        #ffb732;
  --blue:        #3a86ba;
  --green:       #2de0b6;
  --cyan:        #4eecc8;
  --mono:        'IBM Plex Mono', 'Consolas', monospace;
  --sans:        'IBM Plex Sans', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at center top, rgba(58,134,186,0.18), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100vh;
  background-position: top center;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── SITE BAR (shared convention) ───────────────────────────── */
.site-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 30px;
  background: #111119;
  border-bottom: 2px solid var(--border-dim);
}
.site-bar a { text-decoration: none; }
.bar-brand {
  font-family: var(--mono);
  font-size: 16px; font-weight: 700;
  color: var(--red); letter-spacing: 5px;
}
.bar-sep { color: var(--border-dim); font-size: 18px; }
.bar-section {
  font-family: var(--mono);
  font-size: 12px; color: #b0b0b0; letter-spacing: 2px; text-transform: uppercase;
}
.bar-nav { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; }
.bar-link {
  font-family: var(--mono);
  font-size: 11px; color: var(--text-dim); letter-spacing: 1px;
  padding: 6px 14px;
  border: 1px solid var(--border-dim); border-radius: 4px;
  transition: all 0.2s;
}
.bar-link:hover { color: #fff; border-color: var(--red); background: #ff554515; }

/* ── HERO (matches /internet-archive/) ─────────────────────── */
.auth-hero {
  position: relative;
  padding: 56px 30px 48px;
  text-align: center;
}
.auth-hero-inner { position: relative; max-width: 1000px; margin: 0 auto; }
.auth-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px; font-weight: 700;
  color: var(--gold);
  letter-spacing: 4px;
  border: 1px solid rgba(255,183,50,0.45);
  padding: 8px 22px; border-radius: 4px;
  margin-bottom: 24px;
  background: var(--bg);
}
.auth-hero h1 {
  font-family: var(--sans);
  font-size: 44px; font-weight: 700;
  color: var(--text-white);
  line-height: 1.15;
  margin-bottom: 18px;
}
.auth-hero h1 em {
  font-style: normal;
  color: var(--gold);
}
.auth-hero-sub {
  font-size: 18px; color: #b0b0b0;
  line-height: 1.65;
  max-width: 880px;
  margin: 0 auto 36px;
}
.auth-hero-stats {
  display: flex; justify-content: center; gap: 36px; flex-wrap: wrap;
}
.auth-hero-stat { text-align: center; }
.auth-hero-stat .val {
  font-family: var(--mono);
  font-size: 40px; font-weight: 700;
  color: var(--cyan);
  display: block;
}
.auth-hero-stat .val.gold   { color: var(--gold);   }
.auth-hero-stat .val.red    { color: var(--red);    }
.auth-hero-stat .val.blue   { color: var(--blue);   }
.auth-hero-stat .lbl {
  font-family: var(--mono);
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 2px; text-transform: uppercase;
  margin-top: 4px;
}

/* ── PAGE LAYOUT ────────────────────────────────────────────── */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 30px 60px;
}

.section-block { margin-bottom: 56px; }
.section-label {
  font-family: var(--mono);
  font-size: 14px; font-weight: 700;
  color: var(--red);
  letter-spacing: 4px; text-transform: uppercase;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-h {
  font-size: 28px; font-weight: 700;
  color: var(--text-white);
  margin-bottom: 18px; line-height: 1.25;
}
.section-sub {
  font-size: 16px; color: var(--text-dim);
  margin-bottom: 28px; max-width: 880px;
}

.prose p {
  font-size: 17px; line-height: 1.75;
  color: var(--text); margin-bottom: 18px;
}
.prose strong { color: var(--text-white); }
.prose em { color: var(--gold); font-style: normal; }
.prose code {
  font-family: var(--mono); font-size: 14px;
  color: var(--cyan); background: #111119;
  padding: 1px 6px; border-radius: 3px;
}
.prose a {
  color: var(--blue); text-decoration: none;
  border-bottom: 1px solid rgba(58,134,186,0.4);
}
.prose a:hover { color: var(--cyan); border-color: var(--cyan); }

/* ── LAYER CARDS ────────────────────────────────────────────── */
.layer-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.layer-card {
  background: var(--surface);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  padding: 22px 26px;
  border-left: 5px solid var(--cyan);
}
.layer-card.l1 { border-left-color: var(--cyan); }
.layer-card.l2 { border-left-color: var(--gold); }
.layer-card.l3 { border-left-color: var(--green); }
.layer-card.l4 { border-left-color: var(--blue); }
.layer-card.l5 { border-left-color: var(--red); }

.layer-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.layer-num {
  font-family: var(--mono);
  font-size: 14px; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 3px; text-transform: uppercase;
}
.layer-title {
  font-size: 19px; font-weight: 700;
  color: var(--text-white);
}
.layer-tag {
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 1px; padding: 3px 9px;
  border-radius: 3px;
  background: rgba(78,236,200,0.15); color: var(--cyan);
  margin-left: auto;
}
.layer-card.l2 .layer-tag { background: rgba(255,183,50,0.15); color: var(--gold); }
.layer-card.l3 .layer-tag { background: rgba(45,224,182,0.15); color: var(--green); }
.layer-card.l4 .layer-tag { background: rgba(58,134,186,0.18); color: var(--blue); }
.layer-card.l5 .layer-tag { background: rgba(255,85,69,0.15); color: var(--red); }

.layer-body { font-size: 15px; line-height: 1.7; color: var(--text); }
.layer-body strong { color: var(--gold); }
.layer-body code { font-family: var(--mono); font-size: 13px; color: var(--cyan); background: #0c0c12; padding: 1px 6px; border-radius: 3px; }

.layer-stats {
  margin-top: 14px;
  display: flex; flex-wrap: wrap; gap: 24px;
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
}
.layer-stat .v {
  font-family: var(--mono);
  font-size: 18px; font-weight: 700;
  color: var(--text-white);
  display: block;
}
.layer-stat .l {
  font-family: var(--mono);
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 1.5px; text-transform: uppercase;
}

/* ── KEY CORRECTION CALLOUT ─────────────────────────────────── */
.correction-box {
  background: #161622;
  border: 1px solid rgba(78,236,200,0.4);
  border-left: 5px solid var(--cyan);
  border-radius: 8px;
  padding: 24px 28px;
  margin-top: 8px;
}
.correction-eyebrow {
  font-family: var(--mono);
  font-size: 11px; color: var(--cyan);
  letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 8px;
}
.correction-h {
  font-size: 22px; font-weight: 700;
  color: var(--text-white);
  margin-bottom: 14px;
  line-height: 1.3;
}
.correction-body {
  font-size: 16px; line-height: 1.7; color: var(--text);
}
.correction-body strong { color: var(--gold); }
.correction-table {
  margin-top: 16px; padding: 14px 18px;
  background: #0c0c12; border-radius: 6px;
  font-family: var(--mono); font-size: 13px;
  color: var(--text-dim);
}
.correction-table .row {
  display: flex; justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #1a1a28;
}
.correction-table .row:last-child { border-bottom: none; }
.correction-table .row .v { color: var(--cyan); font-weight: 700; }

/* ── REPORT VIEWER (TABBED) ─────────────────────────────────── */
.report-viewer { background: var(--surface); border: 1px solid var(--border-dim); border-radius: 8px; overflow: hidden; }
.report-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #0c0c12;
  border-bottom: 1px solid var(--border-dim);
}
.report-tab {
  padding: 14px 16px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
/* Grid borders: remove the right border on each row's last column (3, 6)
   and the bottom border on the bottom row (last 3 items). */
.report-tab:nth-child(3n)         { border-right: none; }
.report-tab:nth-last-child(-n+3)  { border-bottom: none; }
/* Narrow viewports — drop to 2 columns, then 1. */
@media (max-width: 760px) {
  .report-tabs { grid-template-columns: repeat(2, 1fr); }
  .report-tab { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .report-tab:nth-child(3n)        { border-right: 1px solid var(--border); }
  .report-tab:nth-child(2n)        { border-right: none; }
  .report-tab:nth-last-child(-n+3) { border-bottom: 1px solid var(--border); }
  .report-tab:nth-last-child(-n+2) { border-bottom: none; }
}
@media (max-width: 480px) {
  .report-tabs { grid-template-columns: 1fr; }
  .report-tab { border-right: none; border-bottom: 1px solid var(--border); }
  .report-tab:last-child { border-bottom: none; }
}
.report-tab:hover { color: var(--text-white); background: rgba(78,236,200,0.06); }
.report-tab.active {
  color: var(--text-white);
  background: rgba(78,236,200,0.1);
  border-bottom: 3px solid var(--cyan);
  padding-bottom: 11px;
}
.report-tab .tab-num {
  display: block;
  color: var(--cyan);
  font-size: 9px;
  margin-bottom: 4px;
  letter-spacing: 2px;
}
.report-tab .tab-pages {
  display: block;
  font-weight: 400;
  text-transform: none;
  color: var(--text-muted);
  font-size: 10px;
  margin-top: 4px;
  letter-spacing: 0.5px;
}
.report-info {
  padding: 14px 22px;
  background: #161622;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.report-info-title {
  font-family: var(--sans);
  font-size: 15px; font-weight: 600;
  color: var(--text-white);
}
.report-info-meta {
  display: flex; gap: 14px; font-family: var(--mono); font-size: 11px; flex-wrap: wrap;
}
.report-info-meta .meta-size  { color: var(--gold); font-weight: 600; }
.report-info-meta .meta-hash  { color: var(--text-muted); cursor: pointer; }
.report-info-meta .meta-hash:hover { color: var(--cyan); }
.report-info-meta .meta-hash.copied { color: var(--cyan); }
.report-info-actions { display: flex; gap: 8px; }
.report-info-btn {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  text-decoration: none;
  transition: all 0.15s;
}
.report-info-btn:hover { background: var(--cyan); color: var(--bg); }
.report-frame {
  width: 100%;
  height: 720px;
  border: none;
  background: #1a1a28;
}

/* ── DOWNLOAD GROUPS ────────────────────────────────────────── */
.dl-group { margin-bottom: 32px; }
.dl-group-h {
  font-size: 16px; color: #cccccc;
  font-family: var(--mono);
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.dl-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.download-card {
  background: #1a1a28;
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: all 0.2s;
}
.download-card:hover { border-color: var(--cyan); background: #1e1e32; }
.download-card.primary { border-left: 4px solid var(--gold); }
.dl-title {
  font-size: 14px; font-weight: 600; color: var(--text-white);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.dl-badge {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 1px; padding: 3px 8px; border-radius: 3px;
  text-transform: uppercase;
}
.dl-badge.zip  { background: #4eecc815; color: #4eecc8; }
.dl-badge.pdf  { background: #ff554515; color: #ff5545; }
.dl-badge.cer  { background: #3a86ba15; color: #3a86ba; }
.dl-badge.crl  { background: #ffb73215; color: #ffb732; }
.dl-badge.pem  { background: #2de0b615; color: #2de0b6; }
.dl-badge.json { background: #4eecc815; color: #4eecc8; }
.dl-badge.csv  { background: #ffb73215; color: #ffb732; }
.dl-badge.xlsx { background: #2de0b615; color: #2de0b6; }
.dl-badge.txt  { background: #a0a0a015; color: #a0a0a0; }
.dl-badge.png  { background: #ff554515; color: #ff5545; }
.dl-badge.py   { background: #3a86ba15; color: #3a86ba; }
.dl-desc { font-size: 13px; color: var(--text-dim); line-height: 1.55; }
.dl-meta {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  font-family: var(--mono); font-size: 11px;
}
.dl-size { color: var(--gold); font-weight: 600; }
.dl-hash { color: var(--text-muted); font-size: 10px; cursor: pointer; }
.dl-hash:hover { color: var(--cyan); }
.dl-hash.copied { color: var(--cyan); }
.dl-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.dl-btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid;
  transition: all 0.15s;
}
.dl-btn.download {
  background: #1e1e32; color: var(--cyan); border-color: var(--cyan);
}
.dl-btn.download:hover { background: var(--cyan); color: var(--bg); }
.dl-btn.ots {
  background: #1e1e32; color: var(--gold); border-color: rgba(255,183,50,0.5);
}
.dl-btn.ots:hover { background: var(--gold); color: var(--bg); }

/* ── INTEGRITY / VERIFY BOX ─────────────────────────────────── */
.integrity-box {
  background: #111119;
  border: 1px solid var(--border-dim);
  border-left: 4px solid var(--cyan);
  border-radius: 6px;
  padding: 18px 22px;
  font-size: 14px; color: var(--text); line-height: 1.7;
}
.integrity-box strong { color: var(--cyan); }
.integrity-box code {
  font-family: var(--mono); font-size: 12px;
  color: var(--cyan); background: #0c0c12;
  padding: 1px 6px; border-radius: 3px;
}
.integrity-box pre {
  background: #0c0c12;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 10px 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  line-height: 1.55;
}

/* ── CROSS-LINK CONSTELLATION ───────────────────────────────── */
.constellation {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.xlink {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  text-decoration: none;
  transition: all 0.2s;
  border-top: 4px solid var(--cyan);
}
.xlink:hover { border-color: var(--cyan); background: #161626; }
.xlink.gold { border-top-color: var(--gold); }
.xlink.green { border-top-color: var(--green); }
.xlink.blue { border-top-color: var(--blue); }
.xlink-label {
  font-family: var(--mono);
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 6px;
}
.xlink-title {
  font-size: 16px; font-weight: 600;
  color: var(--text-white);
  margin-bottom: 6px;
}
.xlink-desc {
  font-size: 13px; color: var(--text-dim);
  line-height: 1.55;
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.auth-footer {
  border-top: 1px solid var(--border);
  padding: 30px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.auth-footer a { color: var(--blue); text-decoration: none; }
.auth-footer a:hover { color: var(--cyan); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-hero h1 { font-size: 30px; }
  .auth-hero-stats { gap: 20px; }
  .auth-hero-stat .val { font-size: 24px; }
  .section-h { font-size: 22px; }
  .prose p { font-size: 15px; }
  .page { padding: 30px 18px 40px; }
  .report-tab { min-width: 110px; padding: 10px 12px; font-size: 10px; }
  .report-frame { height: 480px; }
  .layer-stats { gap: 14px; }
}
