/* =====================================================================
   Anniversary Letter Collection — warm, elegant, family-oriented styles.
   Screen styles only. Print styles live in print.css.
   ===================================================================== */

:root {
  --cream: #fbf6ee;
  --cream-2: #f4ead9;
  --paper: #fffdf9;
  --ink: #3a2e2a;
  --ink-soft: #6b5d55;
  --rose: #a23a52;
  --rose-dark: #7f2b3e;
  --gold: #c39b45;
  --gold-soft: #e7d6a8;
  --line: #e6dccb;
  --ok: #2f7d5b;
  --danger: #b23b3b;
  --shadow: 0 10px 40px rgba(90, 60, 40, 0.12);
  --radius: 18px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(1200px 500px at 50% -200px, #fff6e9 0%, rgba(255,255,255,0) 60%),
    linear-gradient(180deg, #fbf6ee 0%, #f7efe1 100%);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 17px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; }

a { color: var(--rose-dark); }

.wrap { max-width: 720px; margin: 0 auto; padding: 24px 20px 80px; }
.wrap-wide { max-width: 1080px; }

/* ---------- Decorative header ---------- */
.hero { text-align: center; padding: 34px 12px 8px; }
.hero .eyebrow {
  font-family: var(--serif);
  font-style: italic;
  color: var(--rose);
  font-size: 1.05rem;
  letter-spacing: .3px;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.1rem);
  color: var(--rose-dark);
  margin: .15em 0 .1em;
}
.hero .sub {
  font-size: clamp(1.05rem, 3.4vw, 1.35rem);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
}
.ornament {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--gold); margin: 14px 0 6px;
}
.ornament::before, .ornament::after {
  content: ""; height: 1px; width: 64px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.ornament .heart { font-size: 1.2rem; }
.intro {
  max-width: 560px; margin: 8px auto 0; text-align: center;
  color: var(--ink-soft); font-size: 1.02rem;
}
.deadline-pill {
  display: inline-block; margin-top: 14px; padding: 6px 16px;
  background: #fff; border: 1px solid var(--gold-soft); color: var(--rose-dark);
  border-radius: 999px; font-size: .92rem; font-weight: 700;
}

/* ---------- Card ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-top: 22px;
}
@media (min-width: 640px) { .card { padding: 34px; } }

/* ---------- Form ---------- */
.field { margin-bottom: 22px; }
.field > label {
  display: block; font-weight: 800; font-size: 1.05rem;
  margin-bottom: 8px; color: var(--ink);
}
.field .hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: .92rem; margin-top: 2px; }

input[type="text"], textarea {
  width: 100%; font-family: inherit; font-size: 1.08rem; color: var(--ink);
  background: #fff; border: 2px solid var(--line); border-radius: 12px;
  padding: 14px 16px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 220px; resize: vertical; line-height: 1.6; }
input[type="text"]:focus, textarea:focus {
  outline: none; border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(162, 58, 82, .12);
}
.counter { text-align: right; font-size: .82rem; color: var(--ink-soft); margin-top: 6px; }
.counter.warn { color: var(--danger); }

/* Honeypot — visually hidden but present for bots */
.hp {
  position: absolute !important; left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

/* ---------- Photo uploader ---------- */
.dropzone {
  border: 2px dashed var(--gold-soft);
  background: #fffdf7;
  border-radius: 14px;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.drag {
  background: #fff7e8; border-color: var(--gold);
}
.dropzone .big { font-size: 2rem; }
.dropzone .add-btn {
  display: inline-block; margin-top: 8px; font-weight: 800; color: var(--rose-dark);
}
.dropzone small { display: block; color: var(--ink-soft); margin-top: 6px; }

.previews {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px; margin-top: 16px;
}
.thumb {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: #fff; aspect-ratio: 1 / 1;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .rm {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px;
  border-radius: 50%; border: none; background: rgba(20,10,10,.62); color: #fff;
  font-size: 1rem; cursor: pointer; display: grid; place-items: center; line-height: 1;
}
.thumb .rm:hover { background: var(--danger); }
.thumb .status {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.7); font-size: .8rem; color: var(--ink-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 800; font-size: 1.05rem;
  border: none; border-radius: 999px; padding: 14px 24px; cursor: pointer;
  transition: transform .06s, box-shadow .15s, background .15s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--rose) 0%, var(--rose-dark) 100%);
  color: #fff; box-shadow: 0 8px 22px rgba(127, 43, 62, .28);
  width: 100%; font-size: 1.2rem; padding: 18px 24px;
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(127, 43, 62, .38); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost {
  background: #fff; color: var(--rose-dark); border: 2px solid var(--line);
}
.btn-ghost:hover { border-color: var(--gold); }
.btn-sm { padding: 8px 14px; font-size: .92rem; }

/* ---------- Alerts ---------- */
.alert {
  border-radius: 12px; padding: 12px 16px; margin: 14px 0; font-weight: 600;
}
.alert-error { background: #fdeceb; color: var(--danger); border: 1px solid #f3c6c3; }
.alert-info { background: #eef6f1; color: var(--ok); border: 1px solid #cfe6da; }

/* ---------- Success screen ---------- */
.success {
  text-align: center; padding: 40px 20px;
}
.success .mark {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 18px;
  display: grid; place-items: center; font-size: 2.4rem;
  background: radial-gradient(circle at 50% 40%, #fff2f4, #f7dbe1);
  color: var(--rose); box-shadow: 0 8px 24px rgba(162,58,82,.2);
}
.success h2 { color: var(--rose-dark); font-size: 1.9rem; }
.success p { color: var(--ink-soft); max-width: 460px; margin: 8px auto; }

.foot { text-align: center; color: var(--ink-soft); font-size: .86rem; margin-top: 30px; }

/* ---------- tiny spinner ---------- */
.spinner {
  width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.closed-note {
  text-align:center; background:#fff; border:1px solid var(--line);
  border-radius: var(--radius); padding: 30px; margin-top: 22px; color: var(--ink-soft);
}
