/* Frotos — Sunset Snap style */
:root {
  --purple: #5B2BC4;
  --purple-dark: #431F94;
  --tangerine: #FF7A3D;
  --gold: #FFB627;
  --night: #1E1033;
  --text-soft: #5A4C6E;
  --lilac: #EDE6FF;
  --cream: #FFF4EC;
  --error-bg: #FDECEC;
  --error-text: #9B1C1C;
  --ok-bg: #EAF7EE;
  --ok-text: #1C6B36;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--night);
  background: #FFFFFF;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--purple); }
a:hover { color: var(--purple-dark); }

/* Header */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--purple);
  padding: 24px 24px 72px;
}
.sun { position: absolute; border-radius: 50%; }
.sun-big { right: -40px; top: -40px; width: 160px; height: 160px; background: var(--tangerine); opacity: 0.9; }
.sun-small { right: 70px; top: 60px; width: 46px; height: 46px; background: var(--gold); }

.brand { position: relative; display: flex; align-items: center; gap: 8px; }
.badge {
  width: 30px; height: 30px; border-radius: 10px; background: var(--gold);
  display: inline-flex; align-items: center; justify-content: center;
}
.wordmark { font-weight: 800; font-size: 26px; color: #FFFFFF; letter-spacing: -0.5px; }

.hero-title {
  position: relative;
  margin: 24px 0 6px;
  font-weight: 800; font-size: 28px; line-height: 1.15; color: #FFFFFF;
}
.hero-text { position: relative; margin: 0; font-size: 15px; color: var(--lilac); }

/* Card */
.card {
  position: relative;
  width: calc(100% - 40px);
  max-width: 440px;
  margin: -44px auto 0;
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(30, 16, 51, 0.14);
  padding: 24px;
}
.card-title { margin: 0; font-size: 20px; font-weight: 600; }
.hint { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-soft); }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack[hidden], [hidden] { display: none !important; }

.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 600; }
input {
  font: inherit;
  font-size: 16px; /* 16px stops phones from zooming in */
  height: 52px;
  padding: 0 16px;
  border: 2px solid #D9D0EA;
  border-radius: 14px;
  color: var(--night);
  background: #FFFFFF;
}
input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(91, 43, 196, 0.2); }
.code-input { font-size: 26px; letter-spacing: 8px; text-align: center; font-weight: 600; }

/* Buttons */
.btn {
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  min-height: 52px;
  border-radius: 999px;
  cursor: pointer;
  padding: 0 20px;
}
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-primary { background: var(--purple); color: #FFFFFF; border: none; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-secondary { background: #FFFFFF; color: var(--purple); border: 2px solid var(--purple); }
.btn-link { background: none; border: none; color: var(--purple); text-decoration: underline; min-height: 44px; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Messages */
.message { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.4; }
.message-error { background: var(--error-bg); color: var(--error-text); }
.message-ok { background: var(--ok-bg); color: var(--ok-text); }

/* Footer */
.footer {
  margin-top: auto;
  padding: 32px 20px 24px;
  display: flex; gap: 8px; justify-content: center;
  font-size: 13px; color: var(--text-soft);
}

/* "We're working on it" page */
.wip-art {
  position: relative;
  width: 180px; height: 180px;
  margin: -90px auto 0;
  border-radius: 50%;
  background: var(--cream);
  border: 6px solid #FFFFFF;
  box-shadow: 0 10px 30px rgba(30, 16, 51, 0.14);
  display: flex; align-items: center; justify-content: center;
}
.wip-hero { padding-bottom: 120px; }
.wip-body {
  max-width: 440px;
  margin: 0 auto;
  padding: 28px 32px 0;
  text-align: center;
  display: flex; flex-direction: column; gap: 10px;
}
.wip-title { margin: 0; font-weight: 800; font-size: 28px; line-height: 1.15; }
.wip-text { margin: 0; font-size: 15px; line-height: 1.5; color: #4A3D5C; }
.wip-small { margin: 0; font-size: 13px; line-height: 1.5; color: #6B5A7E; }
.wip-actions {
  max-width: 440px;
  margin: 24px auto 0;
  padding: 0 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.btn-as-link {
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.btn-as-link.btn-primary, .btn-as-link.btn-primary:hover { color: #FFFFFF; }
.btn-disabled { opacity: 0.5; pointer-events: none; }
.brand-link { text-decoration: none; width: fit-content; }

/* New / Log in tabs */
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 999px; background: #F1ECFA; }
.tab {
  font: inherit; font-size: 15px; font-weight: 600;
  min-height: 44px; border: none; border-radius: 999px;
  background: transparent; color: var(--text-soft); cursor: pointer;
}
.tab-active { background: #FFFFFF; color: var(--purple); box-shadow: 0 2px 6px rgba(30, 16, 51, 0.12); }
.tab:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.field[hidden] { display: none; }

/* Forms (step 3) */
select, textarea {
  font: inherit;
  font-size: 16px;
  padding: 12px 16px;
  border: 2px solid #D9D0EA;
  border-radius: 14px;
  color: var(--night);
  background: #FFFFFF;
}
select { height: 52px; padding-top: 0; padding-bottom: 0; }
textarea { resize: vertical; min-height: 90px; }
select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(91, 43, 196, 0.2); }
.optional { font-weight: 400; color: var(--text-soft); }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 44px; cursor: pointer; }
.check-row input { width: 22px; height: 22px; accent-color: var(--purple); }

/* Pills */
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--lilac); color: var(--purple-dark); }
.pill-date { background: var(--cream); color: #B4410F; }
.pill-live { background: var(--ok-bg); color: var(--ok-text); }
.pill-upcoming { background: var(--lilac); color: var(--purple-dark); }
.pill-ended { background: #FFF3D6; color: #8A5A00; }
.pill-closed { background: #ECEAF0; color: #4A4458; }

/* QR card */
.qr-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
  padding: 4px 0 8px;
}
.qr-title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.25; }
.qr-location { margin: 0; font-size: 14px; color: var(--text-soft); }
.qr-canvas {
  width: 240px; height: 240px;
  border-radius: 16px;
  border: 2px solid #F0E2D6;
  background: #FFFFFF;
}
.qr-link { margin: 0; font-size: 12px; color: var(--text-soft); word-break: break-all; }
.notes { margin: 0; padding: 12px 14px; border-radius: 12px; background: #F8F6FC; font-size: 14px; line-height: 1.5; white-space: pre-line; }

/* Event list */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.empty { margin: 8px 0; text-align: center; color: var(--text-soft); font-size: 15px; }
.event-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.event-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px;
  border: 2px solid #ECE6F7;
  border-radius: 16px;
  text-decoration: none;
  color: var(--night);
}
.event-item:hover, .event-item:focus-visible { border-color: var(--purple); outline: none; }
.event-item-title { font-weight: 600; font-size: 16px; }
.event-item-meta { font-size: 13px; color: var(--text-soft); }
.event-item .pill { align-self: flex-start; margin-top: 4px; }
.section-title { margin: 12px 0 0; font-size: 17px; font-weight: 600; }

/* Guest page (step 4) */
.no-scroll { overflow: hidden; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-danger { background: #B42318; color: #FFFFFF; border: none; }
.cam-buttons { display: flex; flex-direction: column; gap: 10px; }
.cam-buttons[hidden] { display: none; }
.status-note { margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; background: var(--lilac); color: var(--purple-dark); }
.status-live { background: var(--ok-bg); color: var(--ok-text); }
.status-ended, .status-closed { background: #FFF3D6; color: #8A5A00; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  background: #F1ECFA;
  cursor: pointer;
}
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tile-badge {
  position: absolute; left: 6px; bottom: 6px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(30, 16, 51, 0.75); color: #FFFFFF;
}

/* Camera + viewer overlays */
.camera, .viewer {
  position: fixed; inset: 0; z-index: 50;
  background: #000000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.camera[hidden], .viewer[hidden] { display: none; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000000; }
.cam-video[hidden] { display: none; }
#review-img, #review-video { object-fit: contain; }
.mirror { transform: scaleX(-1); }
.cam-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 16px 16px;
}
.cam-round {
  width: 48px; height: 48px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.cam-round[hidden] { visibility: hidden; display: flex; }
.cam-round:focus-visible { outline: 3px solid var(--gold); }
.rec-pill { background: #D92D20; color: #FFFFFF; font-weight: 600; font-size: 15px; padding: 6px 14px; border-radius: 999px; }
.rec-pill[hidden] { display: none; }
.cam-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 16px 16px max(28px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}
.cam-bottom[hidden] { display: none; }
.cam-review { flex-direction: row; justify-content: center; }
.cam-spacer { width: 48px; height: 48px; }
.mode-switch { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); }
.mode-switch[hidden] { display: none; }
.mode-btn {
  font: inherit; font-size: 14px; font-weight: 600;
  min-height: 40px; min-width: 72px; padding: 0 14px;
  border: none; border-radius: 999px; cursor: pointer;
  background: transparent; color: #FFFFFF;
}
.mode-active { background: #FFFFFF; color: var(--night); }
.mode-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.cam-row { width: 100%; max-width: 360px; display: flex; align-items: center; justify-content: space-between; }
.cam-side { width: 72px; }
.cam-flip {
  width: 72px; min-height: 72px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: none; background: none; padding: 0; cursor: pointer;
}
.cam-flip[hidden] { visibility: hidden; display: flex; }
.cam-flip-circle {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex; align-items: center; justify-content: center;
}
.cam-flip-label { color: #FFFFFF; font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.cam-flip:focus-visible .cam-flip-circle { outline: 3px solid var(--gold); outline-offset: 2px; }
.cam-review .btn { flex: 1; max-width: 200px; }
.cam-hint { margin: 0; color: #FFFFFF; font-size: 14px; font-weight: 500; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.shutter {
  width: 80px; height: 80px; border-radius: 50%;
  border: 5px solid #FFFFFF; background: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.shutter:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.shutter-inner { width: 62px; height: 62px; border-radius: 50%; background: #FFFFFF; transition: all 0.15s ease; }
.shutter-video { background: #D92D20; }
.shutter-inner.recording { width: 30px; height: 30px; border-radius: 6px; }
.cam-toast {
  position: absolute; z-index: 3; top: 84px; left: 50%; transform: translateX(-50%);
  margin: 0; padding: 10px 16px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.95); color: var(--night);
  font-size: 14px; font-weight: 500; max-width: 90%; text-align: center;
}
.cam-toast[hidden] { display: none; }

.viewer-media { max-width: 100%; max-height: calc(100% - 160px); object-fit: contain; }
.viewer-media[hidden] { display: none; }
.viewer-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px max(24px, env(safe-area-inset-bottom));
  color: #FFFFFF; font-size: 15px;
}
.viewer-bar .btn[hidden] { display: none; }
