@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800&family=Archivo+Black&display=swap');

:root {
  --bg: #0A0A0A;
  --surface: #111;
  --surface-soft: #1A1A1A;
  --line: #262626;
  --ink: #FFFFFF;
  --ink-soft: #EFEFEF;
  --muted: #9A9A9A;
  --dim: #6B6B6B;
  --gold: #FFB800;
  --gold-bright: #FFCE3D;
  --gold-deep: #E5A500;
  --green: #3FD17A;
  --red: #FF5E47;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  background-image: radial-gradient(ellipse at top, rgba(255,184,0,0.08), transparent 60%);
}

.brand {
  font-family: 'Archivo Black', sans-serif;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.brand .dot { color: var(--gold); }
.brand.small { font-size: 12px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.topbar .logout { color: var(--muted); text-decoration: none; font-size: 14px; }
.topbar .logout:hover { color: var(--ink); }

.container { max-width: 720px; margin: 40px auto; padding: 0 24px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(63,209,122,0.12);
  color: var(--green);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: 'Archivo Black', sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow .green-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
}

h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  margin: 16px 0 8px;
  letter-spacing: -0.02em;
}
.muted { color: var(--muted); margin: 0 0 24px; }
.required { color: var(--gold); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.form .field { margin-bottom: 20px; }
.form label, .form legend {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink-soft);
}
.form input[type=text],
.form input[type=password],
.form textarea,
.form input[type=file] {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.form input[type=text]:focus,
.form input[type=password]:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255,184,0,0.15);
}
.form fieldset { border: none; padding: 0; margin: 0; }

.form select {
  width: 100%;
  padding: 12px 44px 12px 14px;
  background-color: var(--surface-soft);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%23FFB800' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.form select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255,184,0,0.15);
}
.form select:invalid { color: var(--muted); }
.form select option { background: var(--surface); color: var(--ink); }
.form select option:disabled { color: var(--muted); }

label.file-drop {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 16px;
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  min-height: 76px;
  margin-bottom: 0;
}
label.file-drop:hover {
  border-color: var(--gold);
  background: rgba(255,184,0,0.04);
}
label.file-drop.has-file {
  border-style: solid;
  border-color: var(--gold);
  background: rgba(255,184,0,0.06);
}
label.file-drop input[type=file] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.file-icon {
  width: 48px;
  background: rgba(255,184,0,0.12);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
}
.file-icon svg { width: 22px; height: 22px; }
.file-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  text-align: left;
}
.file-text strong { font-weight: 600; word-break: break-word; }
.file-text .file-meta { font-size: 13px; color: var(--muted); }
.file-clear {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
  flex-shrink: 0;
  align-self: center;
}
.file-clear:hover { color: var(--ink); }

.submit-area { position: relative; }
.submit-feedback {
  padding: 14px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 500;
  font-size: 14px;
  animation: feedbackIn 0.25s ease-out;
}
.submit-feedback.is-success {
  background: rgba(63,209,122,0.12);
  color: var(--green);
  border: 1px solid rgba(63,209,122,0.3);
}
.submit-feedback.is-error {
  background: rgba(255,94,71,0.12);
  color: var(--red);
  border: 1px solid rgba(255,94,71,0.3);
}
.feedback-close {
  background: none;
  border: none;
  color: currentColor;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.7;
  flex-shrink: 0;
}
.feedback-close:hover { opacity: 1; }
@keyframes feedbackIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.receipt {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px 28px;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 13px;
  position: relative;
  animation: feedbackIn 0.35s ease-out;
}
.receipt-header {
  font-family: 'Archivo Black', sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.receipt-header::after {
  content: '';
  flex: 1;
  border-top: 1px dashed var(--line);
}
.receipt-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.receipt-item {
  padding: 12px 0;
  border-top: 1px dashed var(--line);
  overflow: hidden;
  animation: printIn 0.55s ease-out;
}
.receipt-item:first-child {
  border-top: none;
  padding-top: 4px;
}
.receipt-item .time {
  color: var(--muted);
  font-size: 12px;
}
.receipt-item .name {
  color: var(--ink);
  font-weight: 600;
  margin-top: 2px;
}
.receipt-item .meta {
  color: var(--muted);
  margin-top: 2px;
}
.receipt-item .updated-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,184,0,0.12);
  color: var(--gold);
  font-family: 'Archivo Black', sans-serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  margin-left: 8px;
  vertical-align: middle;
}
.receipt-foot {
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 8px;
  background:
    linear-gradient(45deg, transparent 33%, var(--bg) 33%, var(--bg) 66%, transparent 66%) 0 0 / 12px 8px,
    linear-gradient(-45deg, transparent 33%, var(--bg) 33%, var(--bg) 66%, transparent 66%) 0 0 / 12px 8px;
}
@keyframes printIn {
  from {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    transform: translateY(-8px);
  }
  to {
    max-height: 200px;
    opacity: 1;
    transform: translateY(0);
  }
}

.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.radio-stack { display: flex; flex-direction: column; gap: 8px; }
.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
}
.radio:hover { border-color: var(--dim); }
.radio input { accent-color: var(--gold); margin: 0; }
.radio:has(input:checked) {
  border-color: var(--gold);
  background: rgba(255,184,0,0.06);
}

.btn-primary {
  background: var(--gold);
  color: #000;
  font-family: 'Archivo Black', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(255,184,0,0.15), 0 10px 24px rgba(255,184,0,0.3);
  transition: transform 0.1s, background 0.15s;
}
.btn-primary:hover { background: var(--gold-bright); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin: 8px 0;
  font-size: 14px;
}
.alert.error {
  background: rgba(255,94,71,0.12);
  color: var(--red);
  border: 1px solid rgba(255,94,71,0.3);
}
.alert.success {
  background: rgba(63,209,122,0.12);
  color: var(--green);
  border: 1px solid rgba(63,209,122,0.3);
}

.typeahead { position: relative; }
.results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 4px 0 0;
  padding: 4px;
  max-height: 280px;
  overflow-y: auto;
  list-style: none;
  z-index: 50;
}
.results li {
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.results li:hover, .results li.active { background: var(--surface-soft); }
.results .name { font-weight: 600; }
.results .meta { color: var(--muted); font-size: 13px; }
.results .badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.1);
  vertical-align: middle;
}

.chosen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--gold);
  border-radius: 10px;
}
.chosen .clear {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.chosen .clear:hover { color: var(--ink); }

body.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 100vh;
}
.auth-card { max-width: 380px; width: 100%; }
.auth-card .brand { margin-bottom: 24px; display: block; }
.auth-card h1 { font-size: 24px; margin: 0 0 4px; }
