/* styles.css — shared layout for every Agentic Expo ticketing screen.
   Colours/fonts come from theme.css. Dark UI matching agenticexpo.ai;
   the printable badge is light for legibility on lanyard stock. */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

/* ---------- header / nav ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .logo { display: flex; align-items: center; gap: 10px; }
.site-header .logo img { height: 28px; display: block; }
.site-header nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.site-header nav a { color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 600; }
.site-header nav a:hover, .site-header nav a.active { color: var(--ink); }

.event-strip {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- layout ---------- */

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 80px; }
.wrap-narrow { max-width: 720px; }
.wrap-wide { max-width: 1280px; }

.hero { text-align: center; padding: clamp(32px, 7vw, 72px) 0 clamp(20px, 4vw, 40px); }
.hero h1 { font-size: clamp(30px, 5.5vw, 52px); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; }
.hero p { color: var(--ink-soft); margin: 0 auto; max-width: 620px; }
.hero .date-venue { margin-top: 14px; font-size: 14px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pill {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
}
.pill.success { background: var(--success-soft); color: var(--success); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.neutral { background: var(--surface-2); color: var(--ink-soft); }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 32px);
  margin: 20px 0;
}
.card.accent-top { position: relative; overflow: hidden; }
.card.accent-top::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient);
}
.card h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.card h3 { margin: 22px 0 8px; font-size: 15px; font-weight: 800; }
.card .lede { color: var(--ink-soft); margin: 0 0 18px; font-size: 14.5px; }

/* ---------- forms ---------- */

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { margin-bottom: 14px; }
.form-group.full { grid-column: 1 / -1; }
label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
label .optional { color: var(--ink-faint); font-weight: 500; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="password"], input[type="date"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 15px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }

.field-error { color: var(--danger); font-size: 13px; margin-top: 5px; display: none; }
.field-error.show { display: block; }
.form-group.has-error input, .form-group.has-error select { border-color: var(--danger); }

.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; }
.check-row input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--violet); flex: none; }
.check-row span { font-size: 13.5px; color: var(--ink-soft); }
.check-row a { color: var(--accent); }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  color: var(--white);
  background: var(--surface-2);
  transition: filter 0.15s, transform 0.05s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--gradient); }
.btn-outline { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 7px; }

/* ---------- notices ---------- */

.notice {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  margin: 14px 0;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
}
.notice.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.notice.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.notice.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- ticket type selector ---------- */

.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.type-option {
  position: relative;
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
}
.type-option input { position: absolute; opacity: 0; }
.type-option .t-name { font-weight: 800; }
.type-option .t-price { font-size: 26px; font-weight: 800; margin: 6px 0 0; display: flex; align-items: baseline; gap: 8px; }
.type-option .t-vat {
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 9px; border-radius: 999px;
}
.type-option .t-gross { font-size: 12px; color: var(--ink-faint); margin: 2px 0 8px; }
.type-option .t-sub { font-size: 13px; color: var(--ink-soft); }

.price-ladder { font-size: 12.5px; color: var(--ink-faint); margin: 14px 0 0; }
.price-ladder strong { color: var(--ink-soft); font-weight: 700; }
.type-option:has(input:checked) {
  border-color: var(--violet);
  background: linear-gradient(rgba(93, 77, 255, 0.08), rgba(216, 63, 255, 0.05));
}
.type-option:has(input:checked) .t-name { color: var(--accent); }

/* ---------- seat email list ---------- */

.seat-list { display: grid; gap: 8px; margin: 10px 0; }
.seat-item { display: flex; gap: 8px; align-items: center; }
.seat-item .row-num { flex: none; width: 26px; text-align: right; color: var(--ink-faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.seat-item input { flex: 1; }
.seat-errors { margin: 10px 0; }
.seat-errors .err-row { color: var(--danger); font-size: 13.5px; padding: 2px 0; }

.qty-stepper { display: flex; align-items: center; gap: 10px; }
.qty-stepper input { width: 90px; text-align: center; font-weight: 800; font-size: 18px; }
.qty-stepper .btn { padding: 10px 16px; }
.qty-max-note { font-size: 13px; color: var(--warn); font-weight: 600; }

.group-line { font-size: 13px; color: var(--ink-faint); margin: 14px 0 0; }
.group-line a { color: var(--accent); font-weight: 700; text-decoration: none; }
.group-line a:hover { text-decoration: underline; }

/* ---------- summary bar ---------- */

.summary {
  border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px;
  font-size: 15px;
}
.summary .total { font-size: 24px; font-weight: 800; }
.summary-lines { display: grid; gap: 6px; }
.summary .s-row { display: flex; justify-content: space-between; align-items: baseline; }
.summary .s-vat { color: var(--ink-soft); font-size: 13.5px; }
.summary .s-total { border-top: 1px solid var(--line-soft); margin-top: 6px; padding-top: 10px; font-weight: 700; }

/* ---------- data tables ---------- */

.table-scroll { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
table.data th {
  text-align: left; padding: 9px 10px; color: var(--ink-soft);
  font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data tr:hover td { background: rgba(255, 255, 255, 0.02); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.nowrap { white-space: nowrap; }

/* ---------- stat tiles ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.stat .n { font-size: 26px; font-weight: 800; }
.stat .l { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.stat.alert .n { color: var(--danger); }
.stat.good .n { color: var(--success); }

/* ---------- badge (shared by ticket.html and badge.html) ---------- */

.badge-card {
  background: var(--white);
  color: var(--phantom);
  width: 100%;
  max-width: var(--badge-screen-max-width);
  margin: 24px auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--smoke);
}
.badge-card .badge-head {
  background: var(--black);
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.badge-card .badge-head img { height: 22px; display: block; }
.badge-card .badge-head .year { color: var(--white); font-weight: 800; font-size: 14px; letter-spacing: 0.12em; }
.badge-card .badge-grad { height: 5px; background: var(--gradient); }
.badge-card .badge-body { padding: 22px 20px 18px; text-align: center; }
.badge-card .b-name { font-size: 26px; font-weight: 800; line-height: 1.15; overflow-wrap: break-word; }
.badge-card .b-role { font-size: 14.5px; color: var(--arsenic); margin-top: 4px; }
.badge-card .b-co { font-size: 15px; font-weight: 700; margin-top: 2px; }
.badge-card .b-type {
  display: inline-block; margin-top: 12px; padding: 4px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  background: var(--cloud); color: var(--arsenic);
}
.badge-card .b-type.founders { background: var(--gradient); color: var(--white); }
.badge-card .qr-holder { margin: 18px auto 6px; width: var(--badge-qr-size); }
.badge-card .qr-holder img, .badge-card .qr-holder canvas { display: block; margin: 0 auto; }
.badge-card .b-ticket { font-family: var(--font-mono); font-size: 13px; color: var(--graphite); letter-spacing: 0.06em; }
.badge-card .badge-foot {
  border-top: 1px solid var(--cloud);
  padding: 10px 20px 16px; text-align: center;
  font-size: 12px; color: var(--graphite);
}

/* ---------- print (badge.html) ---------- */

@media print {
  body { background: var(--white); }
  .no-print { display: none !important; }
  .badge-card {
    max-width: none;
    width: var(--badge-print-width);
    margin: var(--badge-print-margin) auto;
    border: 1px solid var(--steel);
    border-radius: 8px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ---------- scanner ---------- */

#scan-region { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.scan-flash { border-radius: var(--radius-sm); padding: 18px; text-align: center; font-size: 20px; font-weight: 800; margin: 12px 0; }
.scan-flash.in { background: var(--success-soft); color: var(--success); }
.scan-flash.already { background: var(--warn-soft); color: var(--warn); }
.scan-flash.bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- sales charts (admin) ---------- */

.sales-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 28px; margin-bottom: 10px; }
.chart-title { margin: 8px 0 12px !important; }

.chart-bars {
  display: flex; align-items: flex-end; gap: 2px;
  height: 140px; padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.chart-bars .bar {
  flex: 1; min-width: 4px; position: relative;
  background: var(--violet);
  border-radius: 4px 4px 0 0;
  min-height: 0;
}
.chart-bars .bar.zero { background: var(--surface-2); height: 2px !important; border-radius: 1px; }
.chart-bars .bar:hover { filter: brightness(1.25); }
.chart-bars .bar .tip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 9px; font-size: 12px; color: var(--ink); white-space: nowrap; z-index: 5;
}
.chart-bars .bar:hover .tip { display: block; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-faint); margin-top: 6px; }

.funnel { display: grid; gap: 10px; margin-top: 4px; }
.funnel .f-row .f-label {
  display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px;
}
.funnel .f-row .f-label .n { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.funnel .f-row .f-label .l { color: var(--ink-soft); }
.funnel .f-row .f-bar { height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.funnel .f-row .f-fill { height: 100%; background: var(--violet); border-radius: 4px 0 0 4px; min-width: 2px; }
.funnel .f-row .f-pct { font-size: 11px; color: var(--ink-faint); margin-top: 3px; }

@media (max-width: 760px) { .sales-grid { grid-template-columns: 1fr; } }

/* ---------- wallet buttons (ticket page) ---------- */

.wallet-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 4px 0 14px; }
.wallet-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--black); color: var(--white);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 18px; font-size: 14px; font-weight: 700; text-decoration: none;
}
.wallet-btn:hover { border-color: var(--accent); }

/* ---------- promo field (buy page) ---------- */

.promo-row { display: flex; gap: 8px; align-items: flex-start; }
.promo-row input { flex: 1; text-transform: uppercase; }
.promo-applied { color: var(--success); font-size: 13.5px; font-weight: 700; margin-top: 6px; }
.summary .s-promo { color: var(--success); font-size: 13.5px; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 26px clamp(16px, 4vw, 40px);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--ink-faint); font-size: 13px;
}
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer img { height: 20px; opacity: 0.7; }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .form-row, .type-grid { grid-template-columns: 1fr; }
  .site-header { flex-direction: column; align-items: flex-start; }
  .summary { flex-direction: column; gap: 6px; }
}

/* ---------- utility ---------- */

.spacer { height: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hidden { display: none !important; }
