/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #002f4b;
  --blue: #007ced;
  --light-blue: #00b8d7;
  --white: #ffffff;
  --light-bg: #f0f4f8;
  --text: #1a1a2e;
  --text-light: #556;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0,47,75,0.12);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--light-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Screens ───────────────────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100dvh;
  padding: 0 16px 40px;
  flex-direction: column;
  align-items: center;
}
.screen.active {
  display: flex;
}

/* ── Brand Header (gradient strip) ────────────────────────────── */
.brand-header {
  text-align: center;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 60%, var(--light-blue) 100%);
  padding: 28px 0 20px;
  margin-bottom: 24px;
}
.brand-header.compact {
  padding: 20px 0 14px;
  margin-bottom: 16px;
}
.brand-logo-img {
  max-width: 220px;
  height: auto;
}

/* ── Card ──────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.4s ease-out;
}
.center-content {
  text-align: center;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Event Badge ───────────────────────────────────────────────── */
.event-badge {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

/* ── Typography ────────────────────────────────────────────────── */
h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 8px;
}
.subtitle {
  color: var(--text-light);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ── Camera ────────────────────────────────────────────────────── */
#camera-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--blue);
  background: #000;
}
#camera-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror */
}
.btn-shutter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid var(--white);
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: transform 0.15s;
}
.btn-shutter:active {
  transform: translateX(-50%) scale(0.9);
}
.btn-shutter::after {
  content: '';
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white);
  margin: 4px auto;
}

/* ── Selfie Preview ────────────────────────────────────────────── */
.selfie-circle {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 20px;
  border: 4px solid var(--blue);
}
.selfie-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.selfie-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ── Selfie Mini (form header) ─────────────────────────────────── */
.selfie-mini {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 16px;
  border: 3px solid var(--blue);
}
.selfie-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Form ──────────────────────────────────────────────────────── */
.field {
  margin-bottom: 20px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px; /* prevents iOS zoom */
  border: 2px solid #d4dbe3;
  border-radius: 10px;
  background: var(--light-bg);
  color: var(--text);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.field input:focus {
  outline: none;
  border-color: var(--blue);
}
.field input.invalid {
  border-color: #e74c3c;
}

/* ── Toggle ────────────────────────────────────────────────────── */
.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toggle-field label {
  margin-bottom: 0;
}
.toggle {
  width: 52px;
  height: 30px;
  border-radius: 15px;
  border: none;
  background: #ccc;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  padding: 0;
}
.toggle[aria-checked="true"] {
  background: var(--blue);
}
.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.3s;
}
.toggle[aria-checked="true"] .toggle-knob {
  transform: translateX(22px);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--navy);
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 25px;
  padding: 14px 28px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-primary:hover {
  background: #003d63;
}
.btn-primary:active {
  transform: scale(0.97);
}
.btn-large {
  padding: 16px 32px;
  font-size: 17px;
}
.btn-full {
  width: 100%;
}
.btn-text {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 15px;
  cursor: pointer;
  padding: 10px 16px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-text:hover {
  color: var(--navy);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Icon Circles ──────────────────────────────────────────────── */
.icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
  font-weight: bold;
}
.icon-circle.success {
  background: #e3f2fd;
  color: var(--blue);
}
.icon-circle.error {
  background: #fdeaea;
  color: #e74c3c;
}

/* ── Thank You ─────────────────────────────────────────────────── */
.thanks-links {
  margin-top: 24px;
}

/* ── Loader ────────────────────────────────────────────────────── */
.loader {
  width: 40px;
  height: 40px;
  border: 4px solid #d4dbe3;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto 20px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Utilities ─────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .card {
    padding: 24px 20px;
    border-radius: 12px;
  }
  .brand-logo-img {
    max-width: 180px;
  }
  #camera-container {
    width: 240px;
    height: 240px;
  }
  .selfie-circle {
    width: 160px;
    height: 160px;
  }
}
