/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #B8831A;   /* Tirhal gold */
  --primary-h: #9A6C10;   /* darker gold on hover */
  --primary-lt:#FBF4E8;   /* gold tint background */
  --accent:    #7A4E1A;   /* dark brown */
  --success:   #16a34a;
  --danger:    #dc2626;
  --bg:        #F9F6F1;   /* warm off-white */
  --card-bg:   #ffffff;
  --text:      #1C1512;
  --text-muted:#7A6A5A;
  --border:    #E8DDD0;
  --radius:    12px;
  --shadow:    0 4px 28px rgba(120,70,20,.10);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ===== Layout ===== */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 680px;
}

/* ===== Header ===== */
.header {
  background: #1C1512;
  padding: .85rem 2rem;
}
.header-inner {
  max-width: 800px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  /* white bg logo needs a subtle inversion or just use as-is */
  filter: brightness(0) invert(1);   /* makes the gold/dark logo white – remove if logo has transparency */
}
.header-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  color: #D4A84B;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 3px;
}
.brand-tagline {
  color: #9E8060;
  font-size: .62rem;
  letter-spacing: 3px;
  font-weight: 400;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: .8rem;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  letter-spacing: .5px;
}

/* ===== Progress bar ===== */
.progress-bar {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  min-width: 80px;
}
.step-circle {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .9rem;
  background: var(--border);
  color: var(--text-muted);
  border: 2px solid var(--border);
  transition: background .2s, color .2s;
}
.progress-step.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.progress-step.done .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.step-label {
  font-size: .72rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.progress-step.active .step-label { color: var(--primary); font-weight: 600; }
.progress-step.done  .step-label { color: var(--success); font-weight: 500; }
.progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 .5rem;
  margin-bottom: 1.3rem;
  transition: background .2s;
}
.progress-line.filled { background: var(--success); }

/* ===== Typography ===== */
.card-title   { font-size: 1.4rem; font-weight: 700; margin-bottom: .35rem; }
.card-subtitle{ color: var(--text-muted); font-size: .9rem; margin-bottom: 1.75rem; }

/* ===== Alert ===== */
.alert {
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .88rem;
  margin-bottom: 1.25rem;
}
.alert-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

/* ===== Form elements ===== */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-weight: 500;
  font-size: .875rem;
  margin-bottom: .45rem;
  color: #374151;
}
.required { color: var(--danger); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .925rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: auto;
}
input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(184,131,26,.15);
}

/* ===== Events grid ===== */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .75rem;
}

.event-card {
  cursor: pointer;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: .85rem 1rem;
  transition: border-color .15s, box-shadow .15s, background .15s;
  background: #fafafa;
}
.event-card input[type="radio"] { display: none; }

.event-card:hover {
  border-color: var(--primary);
  background: var(--primary-lt);
}
.event-card.selected, .event-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-lt);
  box-shadow: 0 0 0 3px rgba(184,131,26,.15);
}

.event-card-inner {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.event-logo-wrap {
  width: 48px; height: 48px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.event-logo {
  width: 48px; height: 48px;
  object-fit: contain;
  border-radius: 6px;
}
.event-logo-placeholder {
  width: 48px; height: 48px;
  background: #e5e7eb;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.event-info {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.event-category {
  font-size: .68rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.event-name {
  font-weight: 600;
  font-size: .88rem;
  color: var(--text);
}
.event-meta {
  font-size: .77rem;
  color: var(--text-muted);
}

/* ===== Verify input ===== */
.input-with-action {
  display: flex;
  gap: .5rem;
}
.input-with-action input  { flex: 1; }
.input-with-action .email-split { flex: 1; }

/* Split email field */
.email-split {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.email-split:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(184,131,26,.15);
}
.email-split input {
  flex: 1;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: .65rem .75rem;
  background: transparent;
  min-width: 0;
}
.email-split input:focus {
  border: none !important;
  box-shadow: none !important;
}
.email-domain-suffix {
  padding: .65rem .75rem;
  font-size: .85rem;
  color: var(--text-muted);
  background: #f5f0ea;
  border-left: 1.5px solid var(--border);
  white-space: nowrap;
  user-select: none;
  font-style: italic;
}
.email-domain-suffix.domain-set {
  color: var(--accent);
  font-weight: 600;
  font-style: normal;
}

.verify-status { margin-top: .5rem; }
.verified-badge {
  font-size: .83rem;
  color: var(--success);
  font-weight: 500;
}
.verify-error {
  margin-top: .5rem;
  font-size: .83rem;
  color: var(--danger);
  font-weight: 500;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-h); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); }

.btn-verify {
  background: #f3f4f6;
  color: var(--text);
  border: 1.5px solid var(--border);
  white-space: nowrap;
  padding: .65rem 1rem;
}
.btn-verify:hover { background: #e5e7eb; }

.btn-verified {
  background: #dcfce7 !important;
  color: var(--success) !important;
  border-color: #bbf7d0 !important;
  cursor: default !important;
}

.btn:disabled {
  background: #d1d5db !important;
  color: #9ca3af !important;
  border-color: #d1d5db !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.btn-full  { width: 100%; margin-top: .5rem; }
.btn-row   { display: flex; justify-content: space-between; align-items: center; margin-top: 1.25rem; gap: .75rem; }

/* ===== Success page ===== */
.success-wrap { text-align: center; }
.success-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
}

.summary-box {
  background: var(--bg);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
  text-align: left;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: .5rem 0;
  font-size: .9rem;
  border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-label { color: var(--text-muted); font-weight: 500; }
.summary-value { font-weight: 600; max-width: 60%; text-align: right; word-break: break-all; }

/* ===== Responsive ===== */
@media (max-width: 520px) {
  .card { padding: 1.75rem 1.25rem; }
  .events-grid { grid-template-columns: 1fr; }
  .btn-row { flex-direction: column-reverse; }
  .btn-row .btn { width: 100%; }
}
