/* ============================================================
   Bob Judge — Design System
   Monochrome high-contrast style (Wellfound-inspired)
   Font: Hanken Grotesk via Google Fonts
   ============================================================ */

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

/* ── Tokens ── */
:root {
  --ink:             #000000;
  --text-secondary:  #525252;
  --text-muted:      #8a8a8a;
  --line:            #E2E8F0;
  --surface:         #FFFFFF;
  --surface-subtle:  #FAFAFA;
  --bg:              #F5F5F5;
  --hover-blue:      #1D4ED8;
  --hover-blue-tint: #EFF6FF;
  --signal-green:    #16A34A;
  --tint-teal-bg:    #EEF7F7;
  --tint-teal-text:  #0F766E;
  --danger:          #DC2626;
  --danger-hover:    #B91C1C;
  --star-empty:      #D4D4D4;
  --star-filled:     #F59E0B;
  --header-bg:       #FFFFFF;
  --header-text:     #000000;
  --radius-sm:       4px;
  --radius-md:       6px;
  --shadow-float:    0 8px 24px rgba(0,0,0,.12);
  /* legacy aliases kept so old references don't break */
  --border:          #E2E8F0;
  --text-primary:    #000000;
  --accent:          #1D4ED8;
  --radius:          6px;
}

/* NATO group colour palette */
:root {
  --color-alpha:    #0f62fe;
  --color-bravo:    #007d79;
  --color-charlie:  #6929c4;
  --color-delta:    #1192e8;
  --color-echo:     #005d5d;
  --color-foxtrot:  #9f1853;
  --color-golf:     #198038;
  --color-hotel:    #b28600;
  --color-india:    #8a3800;
  --color-juliet:   #4d5358;
  --color-kilo:     #003a6d;
  --color-lima:     #22543d;
  --color-mike:     #31135e;
  --color-november: #4a1d96;
  --color-oscar:    #045559;
  --color-papa:     #750e13;
  --color-quebec:   #6e32c9;
  --color-romeo:    #00539a;
  --color-sierra:   #006161;
  --color-tango:    #7c3aed;
  --color-uniform:  #0e7490;
  --color-victor:   #1e40af;
  --color-whiskey:  #065f46;
  --color-xray:     #5b21b6;
  --color-yankee:   #166534;
  --color-zulu:     #c05621;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.app-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0 24px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.app-header .logo {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.app-header .tagline {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ── Container ── */
.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 16px;
}
.container--wide { max-width: 860px; }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
}
.card + .card { margin-top: 16px; }

/* Card header strip */
.card-header-strip {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--line);
  padding: 10px 24px;
  margin: -24px -24px 20px -24px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

/* ── Group badge ── */
.group-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Star rating ── */
.stars { display: flex; gap: 6px; }
.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 26px;
  color: var(--star-empty);
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.1s, transform 0.1s;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.star-btn.filled,
.star-btn.hover-fill { color: var(--star-filled); }
.star-btn:hover { transform: scale(1.12); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  text-decoration: none;
  font-family: inherit;
  letter-spacing: -0.01em;
}

/* Primary: black fill */
.btn-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn-primary:hover  { background: var(--hover-blue); border-color: var(--hover-blue); }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }

/* Secondary / ghost: white + black border */
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover {
  background: var(--hover-blue-tint);
  border-color: var(--hover-blue);
  color: var(--hover-blue);
}

/* Ghost: no border, subtle hover */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: #f3f4f6; color: var(--ink); }

/* Danger */
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }

/* Full width */
.btn-full { width: 100%; justify-content: center; padding: 11px 16px; font-size: 14px; font-weight: 600; }

/* ── Form inputs ── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label  { font-size: 13px; font-weight: 500; color: var(--ink); }
.form-input {
  padding: 9px 12px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.form-input:focus {
  border-color: var(--hover-blue);
  box-shadow: 0 0 0 2px rgba(29,78,216,.15);
}
.form-error { font-size: 12px; color: var(--danger); }

/* ── Password overlay ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.overlay.hidden { display: none; }
.overlay-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 40px 32px;
  width: 100%; max-width: 360px;
  box-shadow: var(--shadow-float);
}
.overlay-card h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-float);
}
.modal-card h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.modal-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.55;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* Shake animation */
.shake { animation: shake 0.35s ease; }
@keyframes shake {
  0%,100%{transform:translateX(0)}
  20%{transform:translateX(-8px)}
  40%{transform:translateX(8px)}
  60%{transform:translateX(-6px)}
  80%{transform:translateX(6px)}
}

/* ── Waiting / empty state ── */
.waiting-msg { text-align: center; padding: 48px 16px 24px; }
.waiting-msg .waiting-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 20px;
}
.waiting-msg .waiting-icon span {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.18;
  animation: dot-pulse 1.4s infinite ease-in-out both;
}
.waiting-msg .waiting-icon span:nth-child(1) { animation-delay: 0s; }
.waiting-msg .waiting-icon span:nth-child(2) { animation-delay: 0.22s; }
.waiting-msg .waiting-icon span:nth-child(3) { animation-delay: 0.44s; }
@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.15; transform: scale(0.85); }
  40%            { opacity: 1;    transform: scale(1.2);  }
}
.waiting-msg .waiting-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 6px;
}
.waiting-msg .waiting-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Criteria row ── */
.criteria-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  gap: 16px;
  flex-wrap: wrap;
}
.criteria-row:last-child { border-bottom: none; }
.criteria-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 130px;
}
.criteria-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: 400;
}

/* ── Now judging block ── */
.now-judging-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.now-judging-meta { display: flex; flex-direction: column; gap: 3px; }
.now-judging-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.now-judging-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--signal-green);
  margin-left: auto;
  flex-shrink: 0;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--signal-green);
  animation: pulse-dot 1.8s infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ── State screens (thank you / already voted) ── */
.state-screen { text-align: center; padding: 64px 16px; }
.state-icon-wrap {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin: 0 auto 20px;
}
.state-icon-wrap.success { background: #dcfce7; color: var(--signal-green); }
.state-icon-wrap.locked  { background: #f3f4f6; color: #6b7280; }
.state-screen h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.state-screen p { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }

/* ── Teal info pill ── */
.pill-teal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--tint-teal-bg);
  color: var(--tint-teal-text);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}

/* ── Group tracker strip (audience page) ── */
.group-tracker-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.tracker-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  min-width: 64px;
  flex: 1;
  text-align: center;
}
.tracker-tile .tile-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
}
.tracker-tile .tile-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.tracker-tile.is-active {
  border-color: var(--ink);
  background: var(--surface-subtle);
  box-shadow: 0 0 0 2px var(--ink);
}
.tracker-tile.is-active .tile-status {
  color: var(--signal-green);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tracker-tile.is-done { opacity: 0.38; }
.tracker-tile.is-done .tile-badge { background-color: #c6c6c6 !important; color: #6f6f6f; }
.tracker-tile.is-done .tile-status { color: var(--text-muted); }
.tracker-tile.is-upcoming .tile-status { color: var(--text-muted); }

/* ── Responsive ── */

/* Tablet (≤640px): gentle padding reduction only */
@media (max-width: 640px) {
  .container { padding: 24px 14px; }
}

/* Phone (≤480px): mobile-only overrides, desktop layout untouched */
@media (max-width: 480px) {
  .container       { padding: 20px 12px; }
  .container--wide { padding: 20px 12px; }
  .card            { padding: 16px; }
  .card-header-strip {
    padding: 10px 16px;
    margin: -16px -16px 16px -16px;
  }

  /* Stack label above stars */
  .criteria-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 0;
  }
  .criteria-label { min-width: unset; }

  /* Stars: spread full-width, 44px tap targets */
  .stars {
    gap: 0;
    width: 100%;
    justify-content: space-between;
  }
  .star-btn {
    font-size: 32px;
    padding: 6px;
    min-width: 44px;
    min-height: 44px;
  }

  /* Submit: taller tap area */
  .btn-full { padding: 14px 16px; font-size: 15px; }

  /* Group tracker */
  .group-tracker-tiles           { gap: 6px; padding: 12px; }
  .tracker-tile                  { min-width: 56px; padding: 6px 8px; }
  .tracker-tile .tile-badge      { font-size: 10px; padding: 2px 6px; }

  /* Overlays/modals: safe margins */
  .overlay-card { padding: 32px 20px; max-width: calc(100vw - 32px); }
  .modal-card   { padding: 24px 20px; max-width: calc(100vw - 32px); }
}

/* Very small phones (≤360px) */
@media (max-width: 360px) {
  .star-btn { font-size: 28px; min-width: 40px; }
  .tracker-tile { min-width: 48px; }
  .tracker-tile .tile-badge { font-size: 9px; letter-spacing: 0; }
}
