/* ORACLE — shared styles (landing, login, disclaimer gate, console) */

:root {
  --navy: #0F1A2E;
  --navy-soft: #1A2740;
  --navy-border: #2A3550;
  --venous-blue: #5e84bd;
  --arterial-red: #d06f72;
  --burgundy: #8B2435;
  --burgundy-hover: #a02c40;
  --ink: #E8EAED;
  --ink-strong: #FFFFFF;
  --ink-muted: #9aa6bd;
  --line: #2A3550;
  --focus: #8aa6d6;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --band-h: 88px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--navy);
  line-height: 1.6;
  font-size: 17px;
  position: relative;
  overflow-x: hidden;
}

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Ambient background ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient .glow {
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(120px);
  will-change: transform;
}

.ambient .glow-warm {
  background: radial-gradient(circle, rgba(92, 24, 32, 0.15) 0%, rgba(92, 24, 32, 0) 70%);
  top: -10vw;
  left: -5vw;
}

.ambient .glow-cool {
  background: radial-gradient(circle, rgba(14, 58, 92, 0.15) 0%, rgba(14, 58, 92, 0) 70%);
  bottom: -10vw;
  right: -5vw;
}

/* Layering: ambient gradients (0) -> content (2) -> fixed top band (100) */
main,
footer.site-footer { position: relative; z-index: 2; }
main { display: block; }

@keyframes drift-warm {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(50vw, 25vh); }
  50%  { transform: translate(65vw, -10vh); }
  75%  { transform: translate(20vw, 30vh); }
  100% { transform: translate(0, 0); }
}

@keyframes drift-cool {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-45vw, -28vh); }
  50%  { transform: translate(-70vw, 8vh); }
  75%  { transform: translate(-25vw, -32vh); }
  100% { transform: translate(0, 0); }
}

@media (prefers-reduced-motion: no-preference) {
  .ambient .glow-warm { animation: drift-warm 52s ease-in-out infinite; }
  .ambient .glow-cool { animation: drift-cool 58s ease-in-out infinite; }
}

/* ---------- Fixed top band ---------- */
.topband {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--band-h);
  z-index: 100;
  background: #0A1424;
  border-bottom: 1px solid #1F2A40;
  overflow: hidden;
}

.topband-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.topband .wordmark   { flex: 0 0 auto; }
.topband .nav-actions { flex: 0 0 auto; }

/* ---------- Wordmark + nav buttons ---------- */
.wordmark {
  display: inline-block;
  text-decoration: none;
  line-height: 1.05;
}

.wordmark .mark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, var(--venous-blue) 0%, var(--arterial-red) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--ink-strong);
  -webkit-text-fill-color: transparent;
}

.wordmark .by {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  margin-top: 2px;
  -webkit-text-fill-color: currentColor;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  line-height: 1;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  padding: 9px 20px;
  border-radius: 7px;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn-secondary {
  color: var(--ink);
  border-color: rgba(232, 234, 237, 0.45);
  background: transparent;
}
.btn-secondary:hover { background: rgba(232, 234, 237, 0.08); border-color: var(--ink); }

.btn-primary {
  color: var(--ink-strong);
  background: var(--burgundy);
  border-color: var(--burgundy);
}
.btn-primary:hover { background: var(--burgundy-hover); border-color: var(--burgundy-hover); }

.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Disclaimer panel (landing + disclaimer gate) ---------- */
.disclaimer {
  background: var(--navy-soft);
  border: 1px solid var(--navy-border);
  border-left: 5px solid var(--burgundy);
  border-radius: 10px;
  padding: 32px 36px;
}

.disclaimer h2 {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 16px;
}

.disclaimer p {
  margin: 0 0 16px;
  color: var(--ink);
}
.disclaimer p:last-child { margin-bottom: 0; }

.disclaimer .lead {
  font-size: 22px;
  font-weight: 700;
  color: var(--arterial-red);
}

.disclaimer .emphasis {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-strong);
}

.disclaimer .closing {
  font-style: italic;
  font-size: 15px;
  color: var(--ink-muted);
}

/* ---------- Footer ---------- */
footer.site-footer {
  border-top: 1px solid var(--line);
  background: transparent;
}

.footer-inner {
  padding: 28px 0 36px;
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.7;
}
.footer-inner p { margin: 0; }
.footer-inner .fine { margin-top: 8px; font-size: 12px; }
.footer-inner .foot-link { margin-top: 10px; }
.footer-inner .foot-link a { color: var(--venous-blue); text-decoration: none; border-bottom: 1px solid transparent; }
.footer-inner .foot-link a:hover { border-bottom-color: var(--venous-blue); }
.footer-inner .foot-link a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Vertically-centred single-column pages (login, disclaimer, console) ---------- */
.page-center {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--band-h);
}
/* margin:auto centres when there is spare room, and degrades to top-aligned
   scroll (no clipping) when the content is taller than the viewport. */
.page-center > .center-col {
  margin: auto;
  width: 100%;
  padding: 48px 20px 64px;
}

/* ---------- Shared responsive ---------- */
@media (max-width: 767px) {
  body { font-size: 16px; }
  .btn { padding: 8px 16px; font-size: 14px; }
}

@media (max-width: 639px) {
  .wrap { padding: 0 24px; }
  .topband-inner { padding: 0 24px; }
  .disclaimer { padding: 26px 24px; }
  .disclaimer .lead { font-size: 18px; }
  .disclaimer .emphasis { font-size: 16px; }
}

@media (max-width: 479px) {
  .wrap { padding: 0 16px; }
  .topband-inner { padding: 0 16px; }
  .disclaimer { padding: 22px 18px; }
  .page-center > .center-col { padding: 40px 16px 56px; }
}

@media (max-width: 360px) {
  .btn { padding: 8px 14px; }
}

/* ================= Admin control plane ================= */
.admin-tag {
  font-family: var(--mono); font-size: 13px; color: var(--arterial-red);
  margin-left: 6px; letter-spacing: 0.08em; -webkit-text-fill-color: var(--arterial-red);
}
.admin-wrap { padding-top: calc(var(--band-h) + 26px); padding-bottom: 56px; }
.admin-h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 3.4vw, 30px); margin: 0 0 20px; color: var(--ink); }

.admin-nav { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-end; border-bottom: 1px solid var(--navy-border); margin-bottom: 26px; }
.admin-nav a {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-muted); text-decoration: none; padding: 0 0 12px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.admin-nav a:hover { color: var(--ink); }
.admin-nav a.active { color: var(--ink); border-bottom-color: var(--arterial-red); }
.admin-nav a.admin-nav-back { margin-left: auto; color: var(--venous-blue); }
.admin-nav a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.admin-panel { background: var(--navy-soft); border: 1px solid var(--navy-border); border-radius: 10px; padding: 24px; margin-bottom: 20px; }
.admin-panel-h { font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); margin: 0 0 16px; }
.admin-note { font-size: 13px; color: var(--ink-muted); margin: 12px 0 0; line-height: 1.6; }

/* tables */
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--navy-border); white-space: nowrap; }
.admin-table th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); font-weight: 500; }
.admin-table td { color: var(--ink); font-variant-numeric: tabular-nums; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-empty { color: var(--ink-muted); font-size: 13px; padding: 14px 4px; }

/* status pills */
.pill { font-family: var(--mono); font-size: 11px; padding: 2px 9px; border-radius: 10px; letter-spacing: 0.03em; white-space: nowrap; }
.pill-pending { color: #d6a44f; background: rgba(214,164,79,0.13); }
.pill-active { color: #45b6c4; background: rgba(69,182,196,0.13); }
.pill-suspended { color: var(--arterial-red); background: rgba(208,111,114,0.13); }
.pill-rejected, .pill-expired { color: var(--ink-muted); background: rgba(154,166,189,0.1); }
.pill-used { color: var(--venous-blue); background: rgba(94,132,189,0.14); }

/* stat tiles */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479px) { .admin-stats { grid-template-columns: 1fr; } }
.admin-stat { background: #1f2c46; border: 1px solid var(--navy-border); border-radius: 8px; padding: 16px 18px; }
.admin-stat .n { font-size: 26px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.admin-stat .l { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); margin-top: 7px; line-height: 1.4; }

/* system-mode tiles */
.mode-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .mode-tiles { grid-template-columns: 1fr; } }
.mode-tile { border: 1px solid var(--navy-border); border-radius: 10px; padding: 18px; cursor: pointer; background: none; text-align: left; transition: border-color 0.15s ease; min-height: 132px; display: flex; flex-direction: column; color: var(--ink); }
.mode-tile:hover { border-color: var(--venous-blue); }
.mode-tile.active { border-color: var(--arterial-red); border-width: 2px; padding: 17px; background: rgba(208,111,114,0.08); cursor: default; }
.mode-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mode-tile .mt-name { font-family: var(--mono); font-size: 16px; letter-spacing: 0.14em; display: flex; align-items: center; gap: 8px; }
.mode-tile .mt-check { color: var(--arterial-red); }
.mode-tile .mt-sub { font-size: 14px; margin-top: 10px; font-weight: 500; }
.mode-tile .mt-desc { font-size: 12.5px; color: var(--ink-muted); margin-top: 4px; line-height: 1.4; }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(5,10,20,0.72); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay[hidden] { display: none; }
.modal { background: var(--navy-soft); border: 1px solid var(--navy-border); border-radius: 12px; padding: 28px; max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.modal h2 { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 0 0 14px; color: var(--ink); }
.modal p { font-size: 14px; line-height: 1.6; color: var(--ink); margin: 0 0 10px; }
.modal .modal-kv { font-family: var(--mono); font-size: 13px; color: var(--ink-muted); margin: 0 0 4px; }
.modal .modal-kv b { color: var(--ink); }
.modal label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); margin: 14px 0 6px; }
.modal textarea, .modal input { width: 100%; background: #11192b; border: 1px solid var(--navy-border); border-radius: 7px; color: var(--ink); font-family: var(--sans); font-size: 14px; padding: 8px 12px; resize: vertical; }
.modal textarea:focus, .modal input:focus { outline: none; border-color: var(--focus); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; }
.modal-err { color: var(--arterial-red); font-size: 13px; margin-top: 12px; }

/* filters + controls */
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.filter-row > label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.admin-input, .admin-select { background: var(--navy-soft); border: 1px solid var(--navy-border); border-radius: 7px; color: var(--ink); font-family: var(--sans); font-size: 14px; padding: 8px 12px; }
.admin-input:focus, .admin-select:focus { outline: none; border-color: var(--focus); }
.btn-sm { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.act-btn { font-family: var(--sans); font-size: 12px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--navy-border); background: transparent; color: var(--ink); cursor: pointer; margin-right: 6px; }
.act-btn:hover { border-color: var(--venous-blue); }
.act-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.act-btn.danger { color: var(--arterial-red); border-color: rgba(208,111,114,0.4); }
.pagination { display: flex; gap: 16px; align-items: center; margin-top: 18px; font-size: 13px; color: var(--ink-muted); font-family: var(--mono); }
.pagination button { background: none; border: none; color: var(--venous-blue); cursor: pointer; font: inherit; padding: 0; }
.pagination button:disabled { color: var(--ink-muted); opacity: 0.4; cursor: not-allowed; }
