/* ==========================================================================
   dt-giveaways

   Kōda's design system, ported 1:1 from koda/public/comparison.html and
   koda/DESIGN.md so the giveaway pages sit in the same visual family.

   The form keeps its order-ticket structure -- the artifact this audience
   fills in every day -- but wears Kōda's palette: cool near-black, hairline
   borders, mint-teal for live state, and the light pill CTA.

   Note on `muted`: koda/docs/UX_AUDIT.md:53 records it at ~3.7:1 on bg, which
   fails WCAG AA for body text. It is used here for decoration only; anything
   meant to be read uses `text2`.
   ========================================================================== */

:root {
  --bg: #0a0a0b;
  --panel: #131317;
  --panel2: #1a1a20;

  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.13);

  --text: #f2f2ee;
  --text2: #a6a6a2;
  --muted: #65655f;

  --live: #45e0c6;                    /* mint-teal, the Kōda mark */
  --accent: oklch(0.74 0.16 250);     /* electric blue */
  --red: oklch(0.7 0.21 25);

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo,
          Consolas, monospace;

  --radius: 12px;
  --pill: 999px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 24px 16px 64px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--live); }

/* Utility face: labels, tickers, numbers. */
.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* --- Market tabs --------------------------------------------------------- */
/* Two products, two markets. The tab encodes which desk you are on. */

.tabs {
  display: flex;
  gap: 4px;
  max-width: 440px;
  margin: 0 auto 12px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--pill);
}

.tabs a {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--pill);
  color: var(--text2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease;
}

.tabs a:hover { color: var(--text); background: var(--panel2); }

.tabs a[aria-current="page"] {
  background: var(--panel2);
  color: var(--live);
  box-shadow: inset 0 0 0 1px var(--border2);
}

/* --- The ticket ---------------------------------------------------------- */

.ticket {
  max-width: 440px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.ticket__strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  background: var(--panel2);
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--live);
}

.status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px rgba(69, 224, 198, 0.15);
}

.status--closed { color: var(--muted); }
.status--closed .status__dot { background: var(--muted); box-shadow: none; }

.ticket__head { padding: 26px 20px 20px; }

.eyebrow { color: var(--live); margin: 0 0 10px; }

.prize {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(27px, 8vw, 35px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.blurb { margin: 14px 0 0; color: var(--text2); font-size: 14.5px; }

.deadline {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text2);
}

.deadline strong { color: var(--text); font-weight: 600; }

/* --- Fields -------------------------------------------------------------- */

.ticket__body { padding: 4px 20px 20px; display: grid; gap: 16px; }

.field { display: grid; gap: 7px; }

.field__label { color: var(--text2); }

.field__input,
.prefixed input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px; /* 16px stops iOS zooming the page on focus */
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field__input::placeholder { color: var(--muted); }

.field__input:focus,
.prefixed:focus-within {
  outline: none;
  border-color: var(--live);
  box-shadow: 0 0 0 3px rgba(69, 224, 198, 0.16);
}

/* The @ is fixed furniture, not something the entrant types. */
.prefixed {
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 10px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.prefixed__at {
  display: flex;
  align-items: center;
  padding: 0 2px 0 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 16px;
}

.prefixed input { border: none; background: none; padding-left: 2px; }
.prefixed input:focus { outline: none; box-shadow: none; }

/* No margin, so an empty error collapses instead of pushing the next field
   down the page. */
.field__error {
  margin: 0;
  color: var(--red);
  font-size: 13px;
  line-height: 1.35;
}

.field__error:empty { display: none; }

.field__input[aria-invalid="true"],
.prefixed[data-invalid="true"] { border-color: var(--red); }

/* The honeypot. Positioned off-screen rather than display:none, because some
   bots skip fields that are not rendered at all. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Consent ------------------------------------------------------------- */

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  align-items: start;
  padding: 14px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text2);
  cursor: pointer;
}

.consent input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--live);
  cursor: pointer;
}

.consent[data-invalid="true"] { border-color: var(--red); }

/* --- Action -------------------------------------------------------------- */
/* Kōda's CTA: light pill, dark label, mono caps. */

.ticket__action { padding: 4px 20px 22px; }

.btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--text);
  border: none;
  border-radius: var(--pill);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 140ms ease, transform 80ms ease;
}

.btn:hover:not(:disabled) { opacity: 0.88; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.form-error { margin: 12px 0 0; color: var(--red); font-size: 13.5px; text-align: center; }
.form-error:empty { margin: 0; }

/* --- Fill confirmation --------------------------------------------------- */

.fill { padding: 30px 20px 26px; text-align: center; }

.fill__mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border: 1.5px solid var(--live);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--live);
  font-size: 19px;
  line-height: 1;
}

.fill__title {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--live);
}

.fill__note { margin: 0 0 22px; color: var(--text2); font-size: 14.5px; }

.receipt {
  margin: 0;
  padding: 15px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: left;
  display: grid;
  gap: 9px;
}

.receipt div { display: flex; justify-content: space-between; gap: 16px; font-family: var(--mono); font-size: 12px; }
.receipt dt { color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.receipt dd { margin: 0; color: var(--text); text-align: right; word-break: break-all; }

.footnote {
  max-width: 440px;
  margin: 18px auto 0;
  color: var(--text2);
  font-size: 12px;
  text-align: center;
}

/* --- Propfirm discount banner -------------------------------------------- */
/* Sits below the ticket: enter first, discount second. On a phone the two
   halves stack and the firm chips go full width. */

.promo {
  max-width: 440px;
  margin: 14px auto 0;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.promo__who { display: flex; align-items: center; gap: 12px; min-width: 0; }

.promo__avatar {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border2);
}

.promo__copy { min-width: 0; }

.promo__code {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.promo__code strong { font-weight: 700; }

.promo__tagline { margin: 1px 0 0; font-size: 12.5px; color: var(--text2); }

/* text2 not muted: this is a link, and muted (#65655F) lands at ~3.3:1 on the
   panel, which fails WCAG AA. */
.promo__site {
  display: inline-block;
  margin-top: 5px;
  font-size: 10px;
  color: var(--text2);
  text-decoration: none;
}

a.promo__site:hover { color: var(--live); }

.promo__firms { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }

.firm {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px 7px 8px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.firm img { width: 28px; height: 28px; border-radius: 7px; flex: none; }

a.firm:hover { border-color: var(--border2); }

/* --- Closed state -------------------------------------------------------- */

.closed { padding: 34px 20px; text-align: center; }
.closed h1 { margin: 0 0 10px; font-size: 21px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.closed p { margin: 0; color: var(--text2); font-size: 14.5px; }

/* --- Admin --------------------------------------------------------------- */

.admin { max-width: 1080px; margin: 0 auto; }

.admin__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.admin__title { margin: 0; font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }

.admin__actions { display: flex; align-items: center; gap: 12px; }

.campaigns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; padding: 0; list-style: none; }

.campaigns a {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  color: var(--text2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.campaigns a:hover { border-color: var(--border2); color: var(--text); }

.campaigns a[aria-current="true"] {
  border-color: rgba(69, 224, 198, 0.4);
  color: var(--live);
  background: rgba(69, 224, 198, 0.07);
}

.campaigns .count { color: var(--text); font-weight: 600; }
.campaigns a[aria-current="true"] .count { color: var(--live); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  padding: 12px 15px;
  background: var(--panel2);
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

td { padding: 12px 15px; border-bottom: 1px solid var(--border); white-space: nowrap; }

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--panel); }

td.num { font-family: var(--mono); font-size: 12px; color: var(--text2); }
td.handle { font-family: var(--mono); font-size: 13px; color: var(--live); }
td.time { font-family: var(--mono); font-size: 12px; color: var(--text2); }

.empty { padding: 46px 20px; text-align: center; color: var(--text2); }
.empty p { margin: 0 0 6px; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; color: var(--text2); }
.pager a { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-decoration: none; }
.pager a:hover { text-decoration: underline; }

.btn--ghost {
  width: auto;
  padding: 9px 16px;
  background: none;
  border: 1px solid var(--border2);
  color: var(--text);
  text-decoration: none;
  display: inline-block;
}

.btn--ghost:hover { border-color: var(--live); color: var(--live); background: none; opacity: 1; }

/* --- Admin nav ----------------------------------------------------------- */

.admin__nav { display: flex; gap: 6px; }

.admin__nav a {
  padding: 7px 14px;
  border-radius: var(--pill);
  color: var(--text2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.admin__nav a:hover { color: var(--text); background: var(--panel); }

.admin__nav a[aria-current="true"] { background: var(--panel2); color: var(--live); }

.link { color: var(--text); text-decoration: none; }
.link:hover { color: var(--live); text-decoration: underline; }

.flash {
  margin: 0 0 18px;
  padding: 11px 15px;
  background: rgba(69, 224, 198, 0.08);
  border: 1px solid rgba(69, 224, 198, 0.3);
  border-radius: 10px;
  color: var(--live);
  font-size: 13.5px;
}

/* Status pills in the giveaway list. */
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--pill);
  border: 1px solid var(--border2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text2);
}

.pill--open { border-color: rgba(69, 224, 198, 0.4); color: var(--live); background: rgba(69, 224, 198, 0.07); }
.pill--closed { color: var(--muted); }

/* --- Campaign form ------------------------------------------------------- */

.form-card { max-width: 560px; margin: 0 auto; }

.field__hint { margin: 0; color: var(--text2); font-size: 12px; line-height: 1.4; }

textarea.field__input { resize: vertical; min-height: 76px; font-family: var(--sans); }

select.field__input { appearance: none; cursor: pointer; }

.form-card__actions { display: flex; gap: 10px; }
.form-card__actions .btn { flex: 1; }
.form-card__actions .btn--ghost { flex: 0 0 auto; text-align: center; line-height: 1.6; }

.danger {
  max-width: 560px;
  margin: 18px auto 0;
  padding: 16px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.danger__title { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.danger__note { margin: 3px 0 0; font-size: 12.5px; color: var(--text2); }

.btn--danger {
  width: auto;
  padding: 10px 18px;
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
}

.btn--danger:hover:not(:disabled) { background: var(--red); color: var(--bg); opacity: 1; }

/* --- Login --------------------------------------------------------------- */

.login { max-width: 340px; margin: 12vh auto 0; }
.login .ticket__head { padding-bottom: 4px; }

/* --- Quality floor ------------------------------------------------------- */

:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 480px) {
  body { padding: 16px 12px 48px; }
  .ticket__head { padding: 22px 16px 18px; }
  .ticket__body { padding: 4px 16px 18px; }
  .ticket__action { padding: 4px 16px 20px; }
  .tabs a { font-size: 10px; letter-spacing: 0.08em; }
  .promo { gap: 12px; }
  .promo__who { width: 100%; }
  .promo__firms { width: 100%; }
  .firm { flex: 1; justify-content: center; }
}
