/* Sagres · MEO Kalorama 2026 — mobile-first, tablet in the field, desktop in the office. */

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

:root {
  --radius: 16px;
  --radius-sm: 10px;
  --gap: 16px;
  --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent);
  --font: "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Ambient wash so the dark UI doesn't read as flat black under stage lighting. */
.glow {
  position: fixed;
  inset: -30% -30% auto -30%;
  height: 70vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(45% 55% at 20% 0%, color-mix(in srgb, var(--primary) 28%, transparent), transparent 70%),
    radial-gradient(40% 50% at 85% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  filter: blur(20px);
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 14px 18px calc(14px + env(safe-area-inset-top)) 18px;
  padding-top: max(14px, env(safe-area-inset-top));
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { height: 30px; width: auto; max-width: 130px; object-fit: contain; }
.brand-mark {
  font-weight: 800; letter-spacing: .14em; font-size: .82rem;
  color: var(--primary); text-transform: uppercase;
}
.brand-sep { width: 1px; height: 18px; background: color-mix(in srgb, var(--text) 22%, transparent); }
.brand-event {
  font-size: .78rem; letter-spacing: .06em; color: var(--muted);
  text-transform: uppercase; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 8px 18px 40px;
  flex: 1;
}
.wrap.wide { max-width: 1180px; }

.foot {
  position: relative;
  z-index: 1;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  border-top: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
}

h1 { font-size: 2rem; line-height: 1.12; margin: 0 0 6px; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 1.15rem; margin: 0 0 12px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: .95rem; margin: 0 0 10px; font-weight: 700; }
p  { margin: 0 0 14px; }
a  { color: var(--primary); }

.lede { color: var(--muted); margin-bottom: 22px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }

.card {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: var(--gap);
  backdrop-filter: blur(8px);
}
.card.tight { padding: 14px; }

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; }
.field > label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

input[type=text], input[type=tel], input[type=email], input[type=password],
input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%;
  padding: 14px 15px;
  font: inherit;
  font-size: 16px; /* keeps iOS from zooming on focus */
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--text) 16%, transparent);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input.err, textarea.err, select.err { border-color: var(--accent); }

.err-msg { color: var(--accent); font-size: .8rem; margin-top: 6px; display: none; }
.err-msg.show { display: block; }

.row { display: grid; gap: 12px; }
@media (min-width: 520px) { .row.two { grid-template-columns: 1fr 1fr; } }

/* Big tap targets — promoters work one-handed with a queue in front of them. */
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  margin-bottom: 10px;
  background: color-mix(in srgb, var(--bg) 45%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .92rem;
  line-height: 1.4;
  transition: border-color .15s, background .15s;
}
.check:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}
.check input {
  flex: none;
  width: 24px; height: 24px;
  margin: 0;
  accent-color: var(--primary);
}
.check.req span::after { content: " *"; color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 16px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: #05130B;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s, filter .15s, opacity .15s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid color-mix(in srgb, var(--text) 22%, transparent);
}
.btn.accent { background: var(--accent); color: #fff; }
.btn.sm { width: auto; padding: 10px 16px; font-size: .88rem; }
.btn.wa { background: #25D366; color: #04240F; }
.btn.danger { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }

.btn-row { display: grid; gap: 10px; }
@media (min-width: 520px) { .btn-row.two { grid-template-columns: 1fr 1fr; } }

/* ---------- Signature ---------- */

.sigwrap {
  position: relative;
  border: 1.5px dashed color-mix(in srgb, var(--text) 25%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg) 45%, var(--surface));
  overflow: hidden;
}
.sigwrap.signed { border-style: solid; border-color: var(--primary); }
.sigwrap canvas { display: block; width: 100%; height: 180px; touch-action: none; }
.sig-hint {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--muted); font-size: .88rem;
  pointer-events: none;
}
.sigwrap.signed .sig-hint { display: none; }
.sig-bar { display: flex; justify-content: flex-end; padding: 8px; }

/* ---------- Language switch, chips, badges ---------- */

.lang { display: flex; gap: 4px; background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 3px; border-radius: 99px; }
.lang a {
  padding: 6px 13px; border-radius: 99px; font-size: .78rem; font-weight: 700;
  color: var(--muted); text-decoration: none; text-transform: uppercase;
}
.lang a.on { background: var(--primary); color: #05130B; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 99px;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  color: var(--muted);
}
.badge.ok  { background: color-mix(in srgb, var(--primary) 20%, transparent); color: var(--primary); }
.badge.warn{ background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }

.code-chip {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .02em;
}

/* ---------- Lists ---------- */

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 9%, transparent);
  border-radius: var(--radius-sm);
  text-decoration: none; color: inherit;
}
.item:active { background: color-mix(in srgb, var(--surface) 100%, transparent); }
.item .grow { flex: 1; min-width: 0; }
.item .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Video gallery (stand) ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}
.tile {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 100%, transparent);
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.on { border-color: var(--primary); }
.tile .tag {
  position: absolute; left: 6px; bottom: 6px;
  padding: 3px 8px; border-radius: 7px;
  background: rgba(0,0,0,.72);
  font-size: .78rem; font-weight: 800; color: #fff;
  font-variant-numeric: tabular-nums;
}
.tile .noimg { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .7rem; padding: 6px; text-align: center; }

.player {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 46vh;
  border: none;
  border-radius: 12px;
  background: #000;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%; bottom: 22px;
  transform: translate(-50%, 140%);
  z-index: 50;
  max-width: min(520px, calc(100vw - 32px));
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  font-size: .9rem;
  transition: transform .28s cubic-bezier(.2,.9,.3,1);
}
.toast.show { transform: translate(-50%, 0); }
.toast.ok   { border-color: var(--primary); }
.toast.bad  { border-color: var(--accent); }

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

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 4px; }
.tabs a {
  flex: none; padding: 9px 15px; border-radius: 99px;
  font-size: .85rem; font-weight: 650; text-decoration: none;
  color: var(--muted); background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
}
.tabs a.on { background: var(--primary); color: #05130B; border-color: transparent; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid color-mix(in srgb, var(--text) 9%, transparent); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat span { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }

.tablewrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--text) 9%, transparent); }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { padding: 11px 13px; text-align: left; white-space: nowrap; }
th { background: color-mix(in srgb, var(--surface) 100%, transparent); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tbody tr { border-top: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
tbody tr:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }

fieldset { border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
legend { padding: 0 8px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }

.hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.swatch { display: flex; align-items: center; gap: 10px; }
.swatch input[type=color] { width: 52px; height: 44px; padding: 3px; border-radius: 8px; border: 1.5px solid color-mix(in srgb, var(--text) 16%, transparent); background: transparent; }

.notice { padding: 13px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .89rem; }
.notice.ok  { background: color-mix(in srgb, var(--primary) 15%, transparent); border: 1px solid var(--primary); }
.notice.bad { background: color-mix(in srgb, var(--accent) 15%, transparent); border: 1px solid var(--accent); }

.linkbox {
  display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--text) 14%, transparent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
  word-break: break-all;
}

/* ---------- Success / big states ---------- */

.done { text-align: center; padding: 30px 0; }
.done .tick {
  width: 82px; height: 82px; margin: 0 auto 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border: 2px solid var(--primary);
  font-size: 2.4rem;
}
.done .bignum {
  font-size: 3.4rem; font-weight: 800; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1;
  color: var(--primary); margin: 6px 0 18px;
}

.spinner {
  width: 17px; height: 17px;
  border: 2.5px solid rgba(255,255,255,.28);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pending-bar {
  position: sticky; top: 0; z-index: 20;
  margin: -8px -18px 14px;
  padding: 9px 18px;
  background: color-mix(in srgb, var(--accent) 22%, var(--bg));
  border-bottom: 1px solid var(--accent);
  font-size: .8rem; font-weight: 650;
  display: none;
}
.pending-bar.show { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
