:root {
  --ink: #3b3140;
  --muted: #756d7a;
  --cream: #fff9f4;
  --pearl: #fffefe;
  --pink: #f7ccd7;
  --pink-soft: #fdebf0;
  --pink-deep: #d96f91;
  --blue: #d7ecf3;
  --gold: #f0c96d;
  --line: rgba(59, 49, 64, 0.13);
  --phone: 430px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.9), transparent 24%),
    linear-gradient(145deg, #fff7e8 0%, #f8d7df 48%, #d8eef6 100%);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body.dialog-open { overflow: hidden; }

button, input, textarea { font: inherit; }

.phone-app {
  position: relative;
  width: min(100%, var(--phone));
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--cream);
  box-shadow: 0 0 70px rgba(117, 72, 91, 0.12);
}

.hero {
  position: relative;
  min-height: 590px;
  padding: 76px 24px 64px;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,.96), transparent 26%),
    radial-gradient(circle at 14% 72%, rgba(240,201,109,.27), transparent 24%),
    linear-gradient(180deg, #fffaf5 0%, #fde8ee 70%, #eff8fb 100%);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 260px;
  border: 1px solid rgba(217,111,145,.16);
  border-radius: 55% 45% 52% 48%;
  transform: rotate(24deg);
}

.hero::before { left: -132px; top: 260px; }
.hero::after { right: -144px; top: 210px; transform: rotate(-24deg); }

.kicker {
  margin: 0 0 12px;
  color: var(--pink-deep);
  text-transform: uppercase;
  font-size: .75rem;
  font-weight: 850;
  letter-spacing: .18em;
}

h1, h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.04;
}

h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(2.75rem, 13vw, 4rem);
}

h1 em {
  display: inline-block;
  margin-top: 6px;
  color: var(--pink-deep);
  font-weight: 400;
}

h2 { font-size: clamp(2rem, 10vw, 2.8rem); }

.lead {
  position: relative;
  z-index: 1;
  max-width: 345px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.7;
}

.butterfly {
  position: relative;
  width: 94px;
  height: 75px;
  margin: 0 auto 34px;
  filter: drop-shadow(0 14px 20px rgba(117,72,91,.18));
}

.butterfly-wing {
  position: absolute;
  top: 8px;
  width: 48px;
  height: 57px;
  border: 1px solid rgba(217,111,145,.28);
  background:
    radial-gradient(circle at 60% 30%, rgba(255,255,255,.92) 0 4px, transparent 5px),
    linear-gradient(135deg, #fff 0%, #f3abc0 56%, #d7ecf3 100%);
}

.butterfly-wing-left { left: 2px; border-radius: 82% 24% 74% 28%; transform: rotate(-12deg); }
.butterfly-wing-right { right: 2px; border-radius: 24% 82% 28% 74%; transform: rotate(12deg); }
.butterfly-body {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 20px;
  width: 9px;
  height: 45px;
  border-radius: 999px;
  background: #7b617a;
  transform: translateX(-50%);
}

.sparkle {
  position: absolute;
  z-index: 3;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px var(--gold), 28px 44px 0 -2px rgba(217,111,145,.65), -22px 72px 0 -3px #fff;
  animation: twinkle 2.4s ease-in-out infinite alternate;
}

.sparkle-one { top: 90px; left: 54px; }
.sparkle-two { top: 170px; right: 50px; animation-delay: -1.2s; }

@keyframes twinkle { to { opacity: .35; transform: scale(.65) rotate(20deg); } }

.upload-section {
  position: relative;
  padding: 58px 20px 48px;
  background:
    radial-gradient(circle at 100% 8%, rgba(240,201,109,.22), transparent 23%),
    linear-gradient(180deg, #eff9fb 0%, #fff7fb 100%);
}

.section-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.section-heading .kicker { margin-top: 2px; margin-bottom: 8px; }
.section-heading h2 { font-size: clamp(2rem, 10vw, 2.65rem); }

.chapter-number {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--pink-deep);
  background: var(--pink-soft);
}

.chapter-number svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-form {
  display: grid;
  gap: 15px;
  margin-top: 28px;
  border: 1px solid rgba(217,111,145,.14);
  border-radius: 22px;
  padding: 20px;
  background: rgba(255,254,254,.84);
  box-shadow: 0 24px 60px rgba(117,72,91,.11);
  backdrop-filter: blur(12px);
}

.field-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 650;
}

.field-label span { font-weight: 400; }

.field-label input,
.field-label textarea {
  width: 100%;
  border: 1px solid rgba(59,49,64,.17);
  border-radius: 12px;
  padding: 12px 13px;
  color: var(--ink);
  background: rgba(255,255,255,.88);
  outline: none;
}

.field-label input { min-height: 49px; }
.field-label textarea { min-height: 94px; resize: vertical; }

.field-label input:focus,
.field-label textarea:focus {
  border-color: rgba(217,111,145,.72);
  box-shadow: 0 0 0 4px rgba(217,111,145,.13);
}

.file-picker {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 116px;
  border: 2px dashed rgba(217,111,145,.34);
  border-radius: 18px;
  padding: 18px;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(240,201,109,.18), transparent 34%),
    rgba(247,204,215,.18);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.file-picker:hover,
.file-picker:focus-within {
  border-color: rgba(217,111,145,.66);
  background-color: rgba(247,204,215,.3);
  transform: translateY(-1px);
}

.file-picker-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink-deep), #c95d82);
  box-shadow: 0 12px 28px rgba(217,111,145,.26);
}

.file-picker-icon svg { width: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.file-picker strong, .file-picker small { display: block; }
.file-picker strong { line-height: 1.35; }
.file-picker small { margin-top: 5px; color: var(--muted); line-height: 1.4; }

.selection-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(215,236,243,.46);
}

.selection-summary div { display: grid; gap: 2px; }
.selection-summary strong { font-size: .92rem; }
.selection-summary span { color: var(--muted); font-size: .82rem; }
.selection-summary button { border: 0; padding: 6px; color: var(--pink-deep); background: transparent; font-weight: 800; cursor: pointer; }

.file-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.preview-item {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background: #f3e8ec;
  box-shadow: inset 0 0 0 1px rgba(59,49,64,.08);
}

.preview-item img,
.preview-item video { width: 100%; height: 100%; object-fit: cover; }

.preview-item .video-chip {
  position: absolute;
  left: 7px;
  bottom: 7px;
  border-radius: 999px;
  padding: 4px 7px;
  color: #fff;
  background: rgba(59,49,64,.62);
  font-size: .67rem;
  font-weight: 750;
  backdrop-filter: blur(6px);
}

.remove-file {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  color: #fff;
  background: rgba(59,49,64,.64);
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink-deep), #c95d82);
  box-shadow: 0 16px 32px rgba(217,111,145,.25);
  font-weight: 850;
  cursor: pointer;
}

.primary-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.primary-button:disabled { cursor: wait; opacity: .65; }

.form-note { min-height: 22px; margin: 0; color: var(--pink-deep); font-size: .9rem; font-weight: 750; line-height: 1.45; }
.form-note.error { color: #a43e55; }
.honeypot { position: absolute !important; left: -9999px !important; }

.progress-wrap { display: grid; gap: 8px; }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: .84rem; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #f1e2e7; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pink-deep), var(--gold)); transition: width 160ms ease; }

.privacy-card {
  display: flex;
  gap: 15px;
  margin: 0;
  padding: 44px 24px 48px;
  background:
    radial-gradient(circle at 0% 100%, rgba(240,201,109,.22), transparent 32%),
    #fff9f4;
}

.privacy-card h2 { font-size: 1.55rem; }
.privacy-card p { margin: 10px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.lock-mark { display: grid; flex: 0 0 auto; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: var(--pink-deep); background: var(--pink-soft); }
.lock-mark svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }

footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
  color: var(--muted);
  background: #f7e1e7;
  text-align: center;
}

footer p { margin: 0; font-family: Georgia, serif; font-style: italic; font-size: .9rem; }
footer span { color: var(--gold); }

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(59,49,64,.4);
  backdrop-filter: blur(10px);
}

.dialog-backdrop[hidden] { display: none; }

.success-dialog {
  width: min(100%, 380px);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 26px;
  padding: 30px 24px 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(240,201,109,.24), transparent 32%),
    var(--cream);
  box-shadow: 0 30px 90px rgba(59,49,64,.26);
  text-align: center;
}

.success-dialog h2 { font-size: 2.6rem; }
.success-dialog p:not(.kicker) { margin: 15px 0 22px; color: var(--muted); line-height: 1.6; }
.success-dialog .primary-button { width: 100%; }
.success-butterfly {
  width: 78px;
  margin: 0 auto 14px;
  filter: drop-shadow(0 12px 16px rgba(217,111,145,.2));
}
.success-butterfly svg { display: block; width: 100%; height: auto; overflow: visible; }
.success-butterfly-antenna {
  fill: none;
  stroke: #875d78;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Admin */
.admin-app { padding-bottom: 40px; }
.admin-hero { min-height: 300px; padding: 58px 24px 42px; }
.admin-hero h1 { font-size: 3.1rem; }
.admin-shell { padding: 28px 18px; background: linear-gradient(180deg, #eff9fb, #fff7fb); }
.admin-login { display: grid; gap: 14px; padding: 22px; border-radius: 20px; background: rgba(255,255,255,.86); box-shadow: 0 20px 55px rgba(117,72,91,.12); }
.admin-login input { min-height: 50px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.admin-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 20px; }
.admin-toolbar a { color: var(--pink-deep); font-weight: 800; text-decoration: none; }
.admin-toolbar-actions { display: flex; flex-direction: column; gap: 7px; align-items: flex-end; text-align: right; }
.admin-toolbar .admin-download-all { border-radius: 9px; padding: 8px 10px; color: #fff; background: linear-gradient(135deg, var(--pink-deep), #c95d82); box-shadow: 0 10px 22px rgba(217,111,145,.2); font-size: .78rem; }
.admin-count { color: var(--muted); font-size: .88rem; }
.submission-card { margin-bottom: 18px; border: 1px solid rgba(217,111,145,.14); border-radius: 20px; padding: 17px; background: rgba(255,255,255,.86); box-shadow: 0 18px 45px rgba(117,72,91,.09); }
.submission-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.submission-head h2 { font-family: inherit; font-size: 1.05rem; font-weight: 850; }
.submission-head time { color: var(--muted); font-size: .76rem; }
.submission-message { margin: 10px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.admin-media-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-top: 14px; }
.admin-media { position: relative; overflow: hidden; border-radius: 12px; background: #f1e8eb; }
.admin-media img, .admin-media video { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.admin-media video { background: #3b3140; }
.admin-media-actions { display: flex; gap: 5px; padding: 7px; }
.admin-media-actions a, .admin-media-actions button { flex: 1; border: 0; border-radius: 8px; padding: 7px 5px; color: var(--ink); background: #fff; font-size: .72rem; font-weight: 750; text-align: center; text-decoration: none; cursor: pointer; }
.admin-media-actions button { color: #a43e55; }
.delete-submission { width: 100%; margin-top: 12px; border: 1px solid rgba(164,62,85,.2); border-radius: 10px; padding: 9px; color: #a43e55; background: transparent; font-weight: 750; cursor: pointer; }
.empty-admin { border: 1px dashed rgba(217,111,145,.32); border-radius: 18px; padding: 28px 18px; color: var(--muted); background: rgba(255,255,255,.55); text-align: center; }

@media (min-width: 700px) {
  .phone-app { margin-block: 28px; border-radius: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
