:root {
  --bg: #0b0714;
  --surface: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.14);
  --text: #f6f1ff;
  --muted: #a79fbd;
  --teal: #2dd4bf;
  --grad: linear-gradient(120deg, #ff6a3d 0%, #ff3d6b 60%, #c026d3 100%);
}

* { box-sizing: border-box; }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 16px 48px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
}

.bg-backdrop {
  position: fixed;
  inset: -20px;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(255, 106, 61, 0.1), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(192, 38, 211, 0.1), transparent 60%),
    url('Diwali-background-image-01.png') center center / cover no-repeat;
  opacity: 0.15;
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

/* Ambient aurora from attendees dashboard */
.aurora-1, .aurora-2 {
  position: fixed;
  z-index: 0;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.08;
  pointer-events: none;
  animation: drift 18s ease-in-out infinite alternate;
}
.aurora-1 { top: -20vw; left: -10vw; background: #ff6a3d; }
.aurora-2 { bottom: -25vw; right: -15vw; background: #7c3aed; animation-delay: -9s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vw, 4vw, 0) scale(1.15); }
}

.page-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.brand-header {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.brand-logo {
  max-width: 260px;
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 30px rgba(208, 28, 34, 0.3));
}

.card {
  width: 100%;
  padding: 32px 28px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 500;
}

.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #ff6a3d; }
h1 { margin: 0 0 8px; font-size: 32px; font-weight: 800; letter-spacing: -0.01em; text-transform: uppercase; }
h2 { margin: 12px 0 8px; font-size: 22px; font-weight: 700; }
.lead { margin: 0 0 24px; color: var(--muted); font-weight: 600; }

label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
label[for="searchInput"] { color: var(--teal); }

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2); }

.hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); opacity: 0.55; }

.results { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.results li button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.results li button:hover, .results li button:focus-visible { transform: translateY(-1px); border-color: var(--teal); background: rgba(45, 212, 191, 0.1); outline: none; }
.results .rid { color: var(--muted); font-size: 13px; white-space: nowrap; }

form { display: flex; flex-direction: column; gap: 24px; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }

.chosen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.08);
}
.chosen strong { display: block; font-weight: 600; }
.chosen span { font-size: 13px; color: var(--muted); font-weight: 500; }

.guest-food-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}
.guest-group legend {
  color: #38bdf8;
  font-size: 13px;
  font-weight: 500;
}

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.locations-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 520px) {
  .locations-grid { grid-template-columns: repeat(2, 1fr); }
}
.option { margin: 0; position: relative; }
.option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-veg {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
}
.dot-nonveg {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
}
.option:hover span {
  transform: translateY(-1px);
  border-color: var(--teal);
}
.option input:checked + span { border-color: var(--teal); background: rgba(45, 212, 191, 0.16); box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18); }
.option input:focus-visible + span { outline: 2px solid #ff6a3d; outline-offset: 2px; }

.primary {
  padding: 14px 16px;
  font: inherit;
  font-weight: 600;
  color: #ffffff;
  background: #ff6a3d;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 106, 61, 0.35);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.primary:hover {
  transform: translateY(-2px);
  background: #f45a2b;
  box-shadow: 0 12px 30px rgba(255, 106, 61, 0.45);
}
.primary:disabled { opacity: 0.6; cursor: wait; transform: none; }

.link { font: inherit; font-size: 13px; font-weight: 600; color: var(--teal); background: none; border: 0; cursor: pointer; padding: 0; }
.link:hover { text-decoration: underline; }

.error {
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: #fecdd3;
  background: rgba(225, 29, 72, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(225, 29, 72, 0.2);
  animation: slideShake 0.35s ease-out;
}
.error-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #fb7185;
}
@keyframes slideShake {
  0% { opacity: 0; transform: translateY(-4px); }
  25% { opacity: 1; transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  100% { opacity: 1; transform: translateX(0); }
}

.fieldset-error legend {
  color: #fb7185 !important;
}
.fieldset-error .option span {
  border-color: rgba(244, 63, 94, 0.45);
}

.overwrite-banner {
  margin-bottom: 24px;
  padding: 16px 18px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
  animation: slideInDown 0.3s ease-out;
}
.overwrite-banner-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  display: grid;
  place-items: center;
  color: #fbbf24;
}
.overwrite-banner-content strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 4px;
}
.overwrite-banner-content p {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: #fef3c7;
}
.overwrite-banner-content span {
  font-weight: 700;
  color: #ffffff;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal styles */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 4, 15, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}
.modal-card {
  max-width: 440px;
  width: 100%;
  background: #171124;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
  font-family: 'Montserrat', system-ui, sans-serif;
  animation: scaleUp 0.2s ease-out;
}
.modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}
.modal-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}
.modal-card p {
  margin: 0 0 24px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
}
.modal-card p strong {
  color: #ffffff;
}
.modal-actions {
  display: flex;
  gap: 12px;
}
.modal-btn {
  flex: 1;
  padding: 12px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
}
.modal-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}
.modal-btn.primary {
  background: #ff6a3d;
  border: 0;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(255, 106, 61, 0.35);
}
.modal-btn.primary:hover {
  background: #f45a2b;
}

/* Success screen */
.done {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0 6px;
}

.done .tick {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7a45 0%, #ff5238 55%, #e11d48 100%);
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(255, 106, 61, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.done .tick svg {
  display: block;
}

.done h2 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
}

.done p {
  margin: 0 0 24px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: #ffffff;
  opacity: 0.75;
  text-align: center;
  max-width: 480px;
}

.done .link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  text-align: center;
  margin: 0 auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

[hidden] { display: none !important; }
