:root {
  --brand-black: #1D1D1B;
  --brand-dark-blue: #312783;
  --brand-cyan: #36A9E1;
  --blue-deep: #20244d;
  --blue-light: #9ed9f5;
  --blue-soft: #7db3e1;
  --bg-main: #f4f7fb;
  --bg-section: #ffffff;
  --border: #e2e8f0;
  --text-main: var(--brand-black);
  --text-muted: #5b6b82;
  --text-inverse: #e5e7eb;
  --error: #dc2626;
  --success: #16a34a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
}

h1, h2, .kicker, .logo {
  font-family: "Outfit", sans-serif;
}

img { max-width: 100%; display: block; }

/* Mobile-first base layout */

.topbar {
  padding: 16px 16px;
  display: flex;
  justify-content: center;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}

.topbar .logo {
  height: 26px;
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 16px 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.hero .kicker {
  color: var(--brand-cyan);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}

.hero h1 {
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--brand-dark-blue);
  margin: 0 0 14px;
}

.hero h1 span {
  color: var(--brand-cyan);
}

.hero .lead {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
}

.card {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(32, 36, 77, 0.1);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-dark-blue);
}

.card-subtitle {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

form {
  display: flex;
  flex-direction: column;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 14px;
  margin-bottom: 6px;
  color: var(--text-muted);
}

input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  /* 16px min prevents iOS Safari from auto-zooming the page on focus */
  font-size: 16px;
  min-height: 48px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(54, 169, 225, 0.18);
}

button {
  margin-top: 22px;
  padding: 14px;
  min-height: 50px;
  width: 100%;
  border: none;
  border-radius: 8px;
  background: var(--brand-dark-blue);
  color: #fff;
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

button:active { background: var(--blue-deep); }

@media (hover: hover) {
  button:hover { background: var(--blue-deep); }
}

button:disabled { opacity: 0.6; cursor: not-allowed; }

.form-msg {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 0.9rem;
}

.form-msg.error { color: var(--error); }
.form-msg.success { color: var(--success); }

.footer {
  text-align: center;
  padding: 20px 16px 32px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer .dot {
  margin: 0 8px;
  color: var(--border);
}

.footer a {
  color: var(--brand-cyan);
  text-decoration: none;
}

.footer a:hover { text-decoration: underline; }

/* Desktop and up */
@media (min-width: 840px) {
  .topbar {
    padding: 28px 24px;
  }

  .topbar .logo {
    height: 34px;
  }

  .page {
    padding: 72px 24px;
    grid-template-columns: 1.15fr 1fr;
    gap: 56px;
    align-items: center;
  }

  .hero .kicker {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    margin-bottom: 18px;
  }

  .hero h1 {
    margin-bottom: 20px;
  }

  .hero .lead {
    font-size: 1.05rem;
  }

  .card {
    padding: 36px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(32, 36, 77, 0.12);
  }

  .card h2 {
    font-size: 1.4rem;
  }

  .card-subtitle {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  button {
    width: auto;
  }

  .footer {
    padding: 28px 20px 40px;
    font-size: 0.85rem;
  }
}

/* QR splash page */

.qr-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
}

.qr-screen {
  margin: auto;
  width: 100%;
  max-width: 460px;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.qr-logo {
  height: 30px;
  margin-bottom: 28px;
}

.qr-screen .kicker {
  color: var(--brand-cyan);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.qr-title {
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.4rem, 6vw, 1.8rem);
  font-weight: 700;
  color: var(--brand-dark-blue);
  margin: 0 0 10px;
}

.qr-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 28px;
}

.qr-card {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(32, 36, 77, 0.1);
}

.qr-image {
  width: min(60vw, 260px);
  height: auto;
  display: block;
}

.qr-fallback-link {
  margin-top: 24px;
  color: var(--brand-cyan);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.qr-fallback-link:hover { text-decoration: underline; }

@media (min-width: 840px) {
  .qr-logo { height: 40px; }
  .qr-image { width: 280px; }
  .qr-card { padding: 28px; }
}

/* Offer / CTA page */

.offer-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.offer-title {
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.7rem, 7vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--brand-dark-blue);
  margin: 0 0 18px;
}

.offer-title span {
  color: var(--brand-cyan);
}

.offer-lead {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0 0 24px;
}

.offer-highlight {
  background: rgba(54, 169, 225, 0.08);
  border: 1px solid rgba(54, 169, 225, 0.3);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 0 0 28px;
}

.offer-highlight p {
  margin: 0;
  color: var(--brand-dark-blue);
  font-size: 0.95rem;
  line-height: 1.6;
}

.offer-highlight strong {
  color: var(--brand-cyan);
}

.hero-highlight {
  margin: 0;
}

.hero-highlight p {
  font-size: 1.05rem;
  font-weight: 600;
}

.offer-cta {
  display: block;
  width: 100%;
  padding: 16px 24px;
  min-height: 52px;
  border-radius: 8px;
  background: var(--brand-dark-blue);
  color: #fff;
  font-family: "Outfit", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
  transition: background 0.15s;
}

@media (hover: hover) {
  .offer-cta:hover { background: var(--blue-deep); }
}

.offer-cta:active { background: var(--blue-deep); }

@media (min-width: 840px) {
  .offer-page {
    padding: 72px 20px 40px;
  }

  .offer-cta {
    width: auto;
    padding: 16px 40px;
  }
}

/* Admin */

.admin-login-card {
  width: 100%;
  text-align: left;
  margin-top: 8px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-logout-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-section);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-logout-btn:hover { border-color: var(--brand-cyan); color: var(--brand-dark-blue); }

.admin-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-dark-blue);
  margin: 0;
}

.admin-export-btn {
  width: auto;
  min-height: auto;
  padding: 10px 20px;
  font-size: 0.9rem;
}

.admin-table-wrap {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  white-space: nowrap;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: rgba(54, 169, 225, 0.06);
}

/* Thank-you modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  background: var(--bg-section);
  border-radius: 16px;
  padding: 36px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
}

.modal-check {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(54, 169, 225, 0.12);
  color: var(--brand-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-check svg {
  width: 28px;
  height: 28px;
}

.modal-card h2 {
  font-family: "Outfit", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brand-dark-blue);
  margin: 0 0 10px;
}

.modal-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 6px;
}

.modal-redirect-note {
  font-size: 0.8rem;
  color: var(--border);
}
