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

:root {
  --rose:       #b5796a;
  --rose-light: #f5e8e4;
  --rose-dark:  #8c5a4d;
  --gold:       #c9a96e;
  --cream:      #fdf8f4;
  --text:       #3a2e2a;
  --text-muted: #8a7570;
  --border:     #e2d5cf;
  --white:      #ffffff;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(90,50,40,.10);
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  padding: 24px 16px 48px;
}

/* ─── Layout ────────────────────────────────────────────────── */
.page-wrapper {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ─── Ornament ──────────────────────────────────────────────── */
.ornament {
  text-align: center;
  color: var(--gold);
  letter-spacing: .5rem;
  font-size: .85rem;
  margin-top: 8px;
}

/* ─── Header ────────────────────────────────────────────────── */
header {
  text-align: center;
}

header h1 {
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  color: var(--rose-dark);
  font-weight: normal;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.subtitle {
  font-size: .95rem;
  color: var(--gold);
  letter-spacing: .08em;
  margin-bottom: 10px;
}

.tagline {
  font-size: .9rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Card (form wrapper) ────────────────────────────────────── */
main {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  border: 1px solid var(--border);
}

/* ─── Fields ────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
}

label {
  font-size: .88rem;
  color: var(--text-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.required { color: var(--rose); }

input[type="text"] {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--cream);
  transition: border-color .2s;
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--rose);
  background: var(--white);
}

input[type="text"].invalid { border-color: #c0392b; }

.field-error {
  font-size: .82rem;
  color: #c0392b;
  min-height: 1em;
}

.file-hint {
  font-size: .78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: .95rem;
  cursor: pointer;
  transition: background .2s, transform .1s, opacity .2s;
  letter-spacing: .02em;
}

.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--rose);
  color: var(--white);
  width: 100%;
  font-size: 1rem;
  padding: 15px;
}

.btn-primary:not(:disabled):hover { background: var(--rose-dark); }

.btn-secondary {
  background: var(--rose-light);
  color: var(--rose-dark);
  border: 1.5px solid var(--border);
  width: 100%;
}

.btn-secondary:hover { background: #ecddd8; }

.btn-icon { font-size: 1.1em; }

/* ─── Preview strip ──────────────────────────────────────────── */
.preview-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.preview-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--rose-light);
  flex-shrink: 0;
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-thumb .thumb-name {
  display: none; /* visible via tooltip / aria */
}

.preview-count {
  font-size: .83rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
  width: 100%;
}

/* ─── Progress ───────────────────────────────────────────────── */
.progress-area {
  margin-bottom: 20px;
}

.progress-text {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-align: center;
}

.progress-bar-track {
  height: 8px;
  background: var(--rose-light);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--gold));
  border-radius: 99px;
  transition: width .3s ease;
  width: 0%;
}

/* ─── Success Screen ─────────────────────────────────────────── */
.success-screen {
  text-align: center;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.success-icon { font-size: 3rem; }

.success-screen h2 {
  font-size: 1.3rem;
  color: var(--rose-dark);
  font-weight: normal;
}

.success-screen p {
  color: var(--text-muted);
  font-size: .9rem;
  font-style: italic;
}

/* ─── Error Banner ───────────────────────────────────────────── */
.error-banner {
  margin-top: 14px;
  padding: 12px 16px;
  background: #fdecea;
  border: 1px solid #f5c6c2;
  border-radius: 8px;
  color: #922b21;
  font-size: .88rem;
  line-height: 1.5;
  text-align: center;
}

/* ─── Footer ─────────────────────────────────────────────────── */
footer {
  text-align: center;
  color: var(--text-muted);
  font-size: .82rem;
  font-style: italic;
}

/* ─── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 400px) {
  main { padding: 24px 18px; }
  .preview-thumb { width: 60px; height: 60px; }
}
