/* ============================================================================
   Gelo Partners — partners.geloapp.com
   ----------------------------------------------------------------------------
   Self-contained stylesheet. No external fonts, no CDN, no build step.
   This site is served as plain static files and must never load anything the
   admin panel loads: partners are untrusted third parties and the separation
   of bundles IS the security property.

   Palette is Gelo's own dark theme, lifted verbatim from
   gelo-flutter/lib/presentation/eventpages/event_theme.dart so the web forms
   and the app read as one product.
   ========================================================================= */

:root {
  /* Surfaces */
  --bg: #0C0C0F;
  --surface: #0F1113;
  --surface-raised: #141519;
  --modal: #1D1E20;
  --border: #1E1E22;
  --border-strong: #2C2C33;

  /* Brand */
  --primary: #4B0AD5;
  --primary-lift: #6E34FF;
  /* Brand violet is too dark to read as text on --bg; this is the lifted tint
     used for links, focus rings and inline accents. Same reasoning as the app. */
  --accent-text: #B9A6FF;

  /* Text */
  --text: #FFFFFF;
  --text-dim: #8A8F95;

  /* Semantic */
  --positive: #4ED597;
  --caution: #E0A02A;
  --negative: #FF6178;

  /* Metrics */
  --r-hero: 16px;
  --r-card: 14px;
  --r-control: 12px;
  --r-chip: 8px;

  --maxw: 760px;
}

/* This site commits to one look on purpose: it is the dark Gelo brand surface,
   not a theme-following document. Backgrounds are painted explicitly so a
   host/browser default can never show through. */

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── Focus: always visible, never removed ─────────────────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 16px 72px;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-lift) 100%);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.5px;
  flex: none;
}

.brand-name {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.2px;
}

.brand-sub {
  font-size: 13px;
  color: var(--text-dim);
  border-left: 1px solid var(--border-strong);
  padding-left: 12px;
  margin-left: 2px;
}

/* ── Landing ──────────────────────────────────────────────────────────────── */
.hero h1 {
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.6px;
  margin: 8px 0 10px;
}

.hero p.lede {
  color: var(--text-dim);
  margin: 0 0 28px;
  font-size: 16px;
  max-width: 52ch;
}

.tiles {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .tiles { grid-template-columns: 1fr 1fr; }
}

.tile {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-hero);
  padding: 24px 22px 22px;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}

.tile:hover,
.tile:focus-visible {
  border-color: var(--primary-lift);
  background: var(--surface-raised);
  transform: translateY(-2px);
}

.tile-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-control);
  background: rgba(110, 52, 255, 0.16);
  border: 1px solid rgba(110, 52, 255, 0.35);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.tile-icon svg { display: block; }

.tile h2 {
  margin: 0 0 6px;
  font-size: 21px;
  letter-spacing: -0.2px;
}

.tile p {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 15px;
}

.tile-cta {
  color: var(--accent-text);
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.landing-note {
  margin-top: 28px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ── Form page chrome ─────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 16px;
}
.back-link:hover { color: var(--text); }

.page-title {
  font-size: clamp(23px, 5.5vw, 30px);
  letter-spacing: -0.4px;
  margin: 0 0 8px;
}

.page-intro {
  color: var(--text-dim);
  margin: 0 0 26px;
  font-size: 15px;
  max-width: 58ch;
}

fieldset.section {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 20px 18px 22px;
  margin: 0 0 18px;
  min-width: 0; /* stops a long input forcing the fieldset wider than the page */
}

fieldset.section > legend {
  padding: 0 8px;
  margin-left: -4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.section-hint {
  color: var(--text-dim);
  font-size: 14px;
  margin: 2px 0 18px;
}

/* ── Fields ───────────────────────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

.row {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .row {
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.req {
  color: var(--accent-text);
  margin-left: 2px;
}

.optional {
  color: var(--text-dim);
  font-weight: 500;
  margin-left: 4px;
  font-size: 13px;
}

.hint {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin: -2px 0 7px;
}

.locked-note {
  display: block;
  font-size: 13px;
  color: var(--caution);
  margin-top: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-control);
  padding: 12px 13px;
  font: inherit;
  font-size: 16px; /* 16px or iOS Safari zooms the whole page on focus */
  transition: border-color .14s ease, box-shadow .14s ease;
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.5;
}

select {
  /* Chevron drawn inline as a data URI — an external icon would need a CDN. */
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%238A8F95' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

/* Date/time pickers render black-on-black in Chrome's dark UI without this. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

input::placeholder,
textarea::placeholder { color: #5A5F66; }

input:hover, select:hover, textarea:hover { border-color: #3A3A43; }

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--primary-lift);
  box-shadow: 0 0 0 3px rgba(110, 52, 255, 0.28);
}

/* Invalid state. aria-invalid is the source of truth so screen readers and the
   paint agree; there is no separate CSS-only "error" class to drift from it. */
[aria-invalid="true"] {
  border-color: var(--negative) !important;
}
[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 97, 120, 0.25);
}

.error-msg {
  display: none;
  color: var(--negative);
  font-size: 13.5px;
  margin-top: 6px;
}
.error-msg.show { display: block; }

.counter {
  float: right;
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 500;
}
.counter.over { color: var(--negative); }

/* ── Yes / No segmented control ───────────────────────────────────────────── */
.segmented {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-control);
  padding: 4px;
  gap: 4px;
}

.segmented input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.segmented label {
  margin: 0;
  cursor: pointer;
  padding: 8px 22px;
  border-radius: var(--r-chip);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
  user-select: none;
  transition: background .14s ease, color .14s ease;
}

.segmented input:checked + label {
  background: var(--primary);
  color: #fff;
}

/* The visually-hidden radio still receives focus; paint the ring on its label. */
.segmented input:focus-visible + label {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

/* ── Repeating schedule rows ──────────────────────────────────────────────── */
.session {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px 15px;
  margin-bottom: 14px;
}

.session-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.session-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sessions-empty {
  color: var(--text-dim);
  font-size: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-card);
  padding: 18px;
  text-align: center;
  margin-bottom: 14px;
}

.cap-note {
  color: var(--caution);
  font-size: 13.5px;
  margin-top: 10px;
}
.cap-note[hidden] { display: none; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  font: inherit;
  font-weight: 600;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  padding: 13px 22px;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, opacity .14s ease;
  min-height: 46px; /* comfortable thumb target on a phone */
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
  font-size: 16px;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-lift); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
  font-size: 15px;
  padding: 11px 18px;
}
.btn-secondary:hover:not(:disabled) { border-color: var(--primary-lift); }

.btn-ghost-danger {
  background: transparent;
  border-color: transparent;
  color: var(--negative);
  font-size: 14px;
  padding: 7px 12px;
  min-height: 36px;
}
.btn-ghost-danger:hover:not(:disabled) { background: rgba(255, 97, 120, 0.12); }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.submit-bar { margin-top: 26px; }

.submit-note {
  color: var(--text-dim);
  font-size: 13.5px;
  margin-top: 12px;
  text-align: center;
}

/* ── Banners ──────────────────────────────────────────────────────────────── */
.banner {
  border-radius: var(--r-card);
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 14.5px;
  border: 1px solid;
}
.banner[hidden] { display: none; }

.banner-error {
  background: rgba(255, 97, 120, 0.10);
  border-color: rgba(255, 97, 120, 0.42);
  color: #FFC2CB;
}

.banner-warn {
  background: rgba(224, 160, 42, 0.10);
  border-color: rgba(224, 160, 42, 0.42);
  color: #F3D49B;
}

/* ── Success panel ────────────────────────────────────────────────────────── */
.success {
  background: var(--surface);
  border: 1px solid rgba(78, 213, 151, 0.4);
  border-radius: var(--r-hero);
  padding: 34px 24px;
  text-align: center;
}
.success[hidden] { display: none; }

.success-check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(78, 213, 151, 0.15);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}

.success h2 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.3px;
}

.success p {
  color: var(--text-dim);
  margin: 0 0 20px;
  font-size: 15px;
}

.reference-box {
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-control);
  padding: 16px;
  margin-bottom: 20px;
}

.reference-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.reference-value {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 21px;
  font-weight: 700;
  color: var(--positive);
  word-break: break-all;
}

.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 40px;
  color: var(--text-dim);
  font-size: 13px;
}

.site-footer a { color: var(--accent-text); }

/* Screen-reader-only, used for the live region that announces errors. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .tile:hover, .tile:focus-visible { transform: none; }
}

/* ============================================================================
   PORTAL CHROME — sign-in, the signed-in bar, and the review status card.
   ----------------------------------------------------------------------------
   Added when the site stopped being two public forms and became a
   code-authenticated portal. Everything above this line still applies; nothing
   above it was changed.
   ========================================================================= */

/* ── Sign-in card ─────────────────────────────────────────────────────────── */
.signin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 22px;
  margin-top: 8px;
}

/* The example code. Monospaced because somebody is comparing it character by
   character against an email, and a proportional font makes that harder. */
.code-sample {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  color: var(--accent-text);
}

/* The code field itself: wide tracking and upper-case, so a typo is visible
   before it is submitted rather than after. */
#access_code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ── Signed-in bar ────────────────────────────────────────────────────────── */
.portal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-control);
}

.portal-who {
  font-weight: 600;
  line-height: 1.3;
}

.portal-sub {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.3;
}

.btn-small {
  padding: 8px 14px;
  font-size: 14px;
  white-space: nowrap;
}

/* ── Review status ────────────────────────────────────────────────────────── */
.status-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  padding: 18px;
  margin-bottom: 24px;
}

.status-card[hidden] { display: none; }

.status-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* The pill carries the meaning, so it must not rely on colour alone — the word
   is always in it. Colour is the second signal, not the only one. */
.status-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid currentColor;
}

.status-pending  { color: var(--caution); }
.status-approved { color: var(--positive); }
.status-rejected { color: var(--negative); }

.status-ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--text-dim);
}

.status-line {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* The reviewer's note. Boxed and labelled, because it is the one piece of text
   on this page written by a person rather than by the product. */
.status-note {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--modal);
  border-left: 3px solid var(--accent-text);
  border-radius: var(--r-chip);
}

.status-note[hidden] { display: none; }

.status-note-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.status-note p { margin: 0; }

/* ── A success banner. The form is no longer replaced on save, so "it worked"
      needs somewhere to live. ────────────────────────────────────────────── */
.banner-ok {
  background: rgba(78, 213, 151, 0.12);
  border: 1px solid rgba(78, 213, 151, 0.4);
  color: var(--positive);
}

/* ── Read-only, organiser-owned fields ────────────────────────────────────── */
input[readonly] {
  background: var(--modal);
  color: var(--text-dim);
  cursor: default;
}

/* Disabled controls once a submission is approved. Legible, not invisible: the
   partner still has to be able to READ what was approved. */
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}
