/* Dhamaka Cracker Sale — shared theme: ivory + deep maroon + muted gold,
   Fraunces (serif, headings) + Work Sans (sans, body). Mobile-first. */

:root {
  --ivory: #FBF3E6;
  --white: #ffffff;
  --maroon: #6E1423;
  --maroon-tint: #FBF6EE;
  --gold: #C89B3C;
  --gold-deep: #D4AF37;
  --brown-dark: #3A2418;
  --brown-mid: #6B5A4D;
  --brown-muted: #8A6F63;
  --taupe: #A7998C;
  --line: #E8DCC8;
  --line-soft: #EFE8DC;
  --error: #B23A2E;
  --success: #2F7D5A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Work Sans', sans-serif;
  background: var(--ivory);
  color: var(--brown-dark);
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--gold); }
a:hover { color: var(--gold-deep); }

input, textarea, button, select { font-family: 'Work Sans', sans-serif; }
input::placeholder, textarea::placeholder { color: #B7A594; }

.serif { font-family: 'Fraunces', serif; }

button { cursor: pointer; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  border: none;
  border-radius: 10px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--maroon);
  width: 100%;
}
.btn-primary:active { transform: scale(0.99); }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  position: relative;
  overflow-x: hidden;
}

.screen { display: flex; flex-direction: column; min-height: 100vh; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11.5px; font-weight: 600; color: var(--brown-muted); letter-spacing: 0.4px;
}
.field input, .field textarea {
  border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 14px;
  font-size: 15px; color: var(--brown-dark); background: #fff; outline: none;
}
.field input.invalid { border-color: var(--error); }
.field-error { font-size: 11.5px; color: var(--error); font-weight: 500; }

.header-bar {
  flex-shrink: 0; padding: 16px 18px 12px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; background: #fff;
}
.header-back {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-soft);
  background: #fff; display: flex; align-items: center; justify-content: center;
}
.header-title { font-weight: 600; font-size: 17px; color: var(--brown-dark); }
.header-step { font-size: 11.5px; color: var(--taupe); margin-top: 1px; }

@keyframes flicker {
  0%, 100% { transform: scaleY(1) scaleX(1) rotate(0deg); opacity: 1; }
  22% { transform: scaleY(1.06) scaleX(0.96) rotate(-1deg); opacity: 0.94; }
  48% { transform: scaleY(0.95) scaleX(1.04) rotate(1deg); opacity: 1; }
  74% { transform: scaleY(1.04) scaleX(0.97) rotate(-0.5deg); opacity: 0.92; }
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.22; transform: scale(1); }
  50% { opacity: 0.32; transform: scale(1.08); }
}
@keyframes firework-burst {
  0% { transform: scale(0.2); opacity: 0; }
  12% { opacity: 0.9; }
  60% { opacity: 0.5; }
  100% { transform: scale(1.7); opacity: 0; }
}
@keyframes spark-fly {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0); opacity: 0; }
}

.firework-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.firework-layer img { position: absolute; object-fit: contain; animation: firework-burst ease-out infinite; }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--line-soft); border-top-color: var(--maroon);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--brown-dark); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; z-index: 999; box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
