/* ============================================================
   EAW Exhibitor Portal — Main Stylesheet
   No framework. Editable by anyone who knows basic CSS.
   Variables at the top — change brand colour in ONE place.
   ============================================================ */

:root {
  --brand:        #0066CC;
  --brand-dark:   #004f99;
  --brand-light:  #e6f0fa;
  --accent:       #00A86B;
  --warn:         #cc7a00;
  --danger:       #c81e1e;
  --success:      #15803d;

  --bg:           #f4f6f8;
  --surface:      #ffffff;
  --border:       #e5e7eb;
  --text:         #1a1a1a;
  --text-muted:   #6b7280;
  --text-light:   #9ca3af;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.04);
  --shadow:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg:    0 10px 25px rgba(0,0,0,0.08);

  --radius:       8px;
  --radius-sm:    4px;
}

/* ====== RESET ====== */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ====== LAYOUT ====== */
.page-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 480px; }
.container-md { max-width: 720px; }

/* ====== AUTH PAGES ====== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(circle at 20% 0%, rgba(0,102,204,0.06), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(0,168,107,0.06), transparent 50%),
    var(--bg);
}
.auth-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}
.auth-card h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}
.auth-card .subtitle {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 14px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo .event-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--brand);
}
.auth-logo .event-tag {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}
.auth-links {
  margin-top: 16px;
  font-size: 14px;
  text-align: center;
  color: var(--text-muted);
}

/* ====== TOP NAV (logged-in pages) ====== */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 16px;
}
.topbar-brand .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-muted);
}
.topbar-user {
  font-weight: 600;
  color: var(--text);
}

/* ====== FORMS ====== */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.field .label-hint {
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 6px;
  font-size: 12px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="date"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,102,204,0.12);
}
.field textarea { min-height: 100px; resize: vertical; }
.field .help { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 4px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: #f8f9fa; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a01818; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ====== ALERTS / FLASH ====== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid transparent;
}
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-error,
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #854d0e; border-color: #fef3c7; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ====== CARDS ====== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ====== DASHBOARD ====== */
.dashboard {
  padding: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.welcome-bar {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.welcome-bar::after {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.welcome-bar h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
  position: relative;
}
.welcome-bar p {
  opacity: 0.9;
  font-size: 14px;
  position: relative;
}
.welcome-meta {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}
.welcome-meta-item .label { opacity: 0.7; display: block; }
.welcome-meta-item .value { font-weight: 600; font-size: 15px; }

/* Progress bar */
.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.progress-label { font-size: 14px; color: var(--text-muted); }
.progress-pct { font-size: 14px; font-weight: 600; color: var(--brand); }
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 0.4s ease;
}

/* Form grid */
.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.form-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.15s;
  display: block;
  color: inherit;
  text-decoration: none;
}
.form-tile:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  text-decoration: none;
  transform: translateY(-1px);
}
.form-tile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 12px;
}
.form-tile-code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--brand);
  background: var(--brand-light);
  padding: 3px 8px;
  border-radius: 4px;
}
.form-tile h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 8px 0 4px;
  color: var(--text);
}
.form-tile p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.form-tile-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-not-started { background: #f3f4f6; color: #4b5563; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-submitted { background: #dbeafe; color: #1e40af; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-revision_required { background: #fed7aa; color: #9a3412; }
.badge-required { background: #fee2e2; color: #991b1b; }
.badge-optional { background: #e0e7ff; color: #3730a3; }
.badge-pending-payment { background: #fef3c7; color: #92400e; }
.badge-paid { background: #d1fae5; color: #065f46; }

/* Footer */
.footer {
  background: #1a1a1a;
  color: #aaa;
  padding: 24px;
  text-align: center;
  font-size: 13px;
  margin-top: auto;
}
.footer a { color: #ddd; }

/* Utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* ====== RESPONSIVE ====== */
@media (max-width: 600px) {
  .auth-card { padding: 28px 20px; }
  .dashboard { padding: 16px; }
  .welcome-bar { padding: 20px; }
  .topbar { padding: 0 16px; }
}

/* ============================================================
   FORM PAGES (added in Module 3)
   ============================================================ */
.form-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}
.form-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.form-header h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}
.form-header .form-code-tag {
  display: inline-block;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.form-header .form-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}
.form-actions-bar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: -1px -1px -1px -1px;
  flex-wrap: wrap;
  z-index: 10;
}
.form-actions-bar .left { color: var(--text-muted); font-size: 13px; }

/* Editable repeater rows (badges, applicants, line items) */
.repeater {
  margin-bottom: 16px;
}
.repeater-row {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}
.repeater-row .row-num {
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.repeater-row .row-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.repeater-row .row-remove:hover { background: #fee2e2; }
.repeater-add {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--brand);
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.repeater-add:hover { border-color: var(--brand); background: var(--brand-light); }

/* Live preview boxes */
.preview-box {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 32px 16px;
  border-radius: var(--radius);
  text-align: center;
  margin: 16px 0;
}
.preview-box .preview-label {
  font-size: 11px;
  opacity: 0.7;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.preview-box .preview-text {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
  word-break: break-word;
}

/* Word counter */
.word-count {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}
.word-count.over-limit { color: var(--danger); font-weight: 600; }

/* Pricing summary */
.totals-card {
  background: linear-gradient(180deg, #fafafa, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 16px 0;
}
.totals-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.totals-row.subtotal { color: var(--text-muted); }
.totals-row.tax     { color: var(--text-muted); }
.totals-row.grand   {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
}

/* Existing file display */
.existing-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
}
.existing-file a { color: var(--success); font-weight: 600; }

/* Section dividers */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Read-only badges for entitlement display */
.entitlement-card {
  background: var(--brand-light);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.entitlement-card strong { color: var(--brand); }
