/* Atamus UI theme
   Reference: dark translucent panels, 1px light borders, square corners,
   uppercase tracked headings, cyan accent with tab underlines, orange for warnings. */

:root {
  --bg-0: #07090d;
  --bg-1: #0d1118;
  --bg-2: #141a24;
  --dust: #3a2d24;              /* warm haze from the reference backdrop */
  --grid: rgba(150, 185, 230, 0.06);

  --panel: rgba(10, 13, 18, 0.88);
  --panel-head: rgba(5, 7, 10, 0.95);
  --line: rgba(200, 220, 255, 0.22);
  --line-soft: rgba(200, 220, 255, 0.10);

  --text: #d6dde8;
  --text-dim: #8d98a8;
  --text-faint: #5b6675;

  --cyan: #2ab6ff;
  --cyan-soft: rgba(42, 182, 255, 0.35);
  --orange: #ff7a2a;

  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

/* ---------- background ---------- */

.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg > * { position: absolute; inset: 0; }

.bg-gradient {
  background:
    radial-gradient(90% 70% at 70% 20%, rgba(78, 58, 44, 0.55) 0%, transparent 60%),
    radial-gradient(80% 70% at 15% 85%, rgba(20, 30, 48, 0.9) 0%, transparent 60%),
    linear-gradient(165deg, var(--bg-2) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  background-size: 200% 200%, 200% 200%, 100% 100%;
  animation: drift 32s ease-in-out infinite alternate;
}

@keyframes drift {
  0%   { background-position: 0% 0%,   100% 100%, 0 0; }
  50%  { background-position: 55% 35%, 45% 65%,   0 0; }
  100% { background-position: 100% 100%, 0% 0%,   0 0; }
}

.bg-grid {
  background-image:
    linear-gradient(to right,  var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, #000 35%, transparent 100%);
          mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, #000 35%, transparent 100%);
}

.bg-noise { width: 100%; height: 100%; opacity: 0.05; mix-blend-mode: screen; }

.bg-vignette {
  background: radial-gradient(ellipse 95% 95% at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.75) 100%);
}

/* ---------- layout ---------- */

main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

/* ---------- panel ---------- */

.card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 24px 60px rgba(0, 0, 0, 0.55);
  padding: 0 28px 26px;
  backdrop-filter: blur(6px);
}

.card-wide { max-width: 560px; }

/* title bar, like "SHIPYARD MODIFICATION CENTER" */
.brand {
  margin: 0 -28px 22px;
  padding: 11px 16px;
  background: var(--panel-head);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text);
}

.subtitle {
  margin: -8px 0 18px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- forms ---------- */

.form { display: flex; flex-direction: column; gap: 16px; }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }

.field > span {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.field > span em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-faint);
}

.field input {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line-soft);
  border-bottom-color: var(--line);
  padding: 9px 11px;
  border-radius: 0;
  outline: none;
  transition: border-color 120ms ease, background 120ms ease;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus {
  border-color: var(--cyan-soft);
  border-bottom-color: var(--cyan);
  background: rgba(0, 0, 0, 0.6);
}
.field input:disabled { opacity: 0.5; }

.field small { font-size: 11.5px; color: var(--text-faint); }

/* recovery fieldset, like the STATS section */
.recovery {
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.recovery legend {
  width: 100%;
  padding: 0 0 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
}
.recovery legend em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-faint);
}
.hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
}
.hint strong { color: var(--orange); font-weight: 500; }

.qa {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-left: 10px;
  border-left: 2px solid var(--line-soft);
}
@media (max-width: 480px) { .qa { grid-template-columns: 1fr; } }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font: inherit;
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.btn-primary {
  margin-top: 4px;
  color: #eaf7ff;
  background: rgba(42, 182, 255, 0.10);
  border: 1px solid var(--cyan);
  box-shadow: inset 0 -2px 0 var(--cyan);
}
.btn-primary:hover {
  background: rgba(42, 182, 255, 0.22);
  box-shadow: inset 0 -2px 0 var(--cyan), 0 0 18px rgba(42, 182, 255, 0.25);
}

.btn-ghost {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(200, 220, 255, 0.45); }

.btn:disabled { opacity: 0.5; cursor: default; }
.btn:focus-visible { outline: 1px solid var(--cyan); outline-offset: 3px; }

.link-small {
  align-self: center;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.link-small:hover { color: var(--cyan); border-bottom-color: var(--cyan-soft); }

/* ---------- messages ---------- */

.msg {
  margin: 0;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  border-left: 2px solid var(--orange);
  background: rgba(255, 122, 42, 0.08);
  color: #ffd2b5;
}
.msg[data-kind="ok"] {
  border-left-color: var(--cyan);
  background: rgba(42, 182, 255, 0.08);
  color: #cdeeff;
}

.is-busy { opacity: 0.85; }

@media (prefers-reduced-motion: reduce) {
  .bg-gradient { animation: none; }
}
