/* =====================================================================
   JENIVEL — DESIGN TOKENS
   A luxury one-gram-gold jewellery aesthetic: deep maroon silk,
   antique gold metalwork, ivory paper. Editorial, not "SaaS card kit".
   ===================================================================== */

:root {
  /* ---- Brand palette (overridable at runtime from store_settings) ---- */
  --maroon-950: #3a0716;
  --maroon-900: #5c0a26;
  --maroon-800: #711433;
  --maroon-700: #8a1f41;
  --gold-100: #f3e6cf;
  --gold-300: #ddbd85;
  --gold-500: #b8894f;
  --gold-600: #9c7038;
  --gold-700: #7d5827;
  --ivory: #fbf6ec;
  --ivory-deep: #f3ead9;
  --paper: #fffdf9;
  --ink: #241512;
  --ink-soft: #5a4844;
  --line: #e7d9c2;
  --success: #2f6b45;
  --danger: #a13232;

  /* ---- Type ---- */
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Jost", "Segoe UI", sans-serif;

  --step-caption: 0.78rem;
  --step-body: 1rem;
  --step-lead: 1.15rem;
  --step-h4: 1.5rem;
  --step-h3: 2rem;
  --step-h2: 2.75rem;
  --step-h1: 3.75rem;

  /* ---- Layout ---- */
  --container-max: 1280px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius-sm: 2px;
  --radius-md: 4px;
  --shadow-soft: 0 10px 30px -12px rgba(58, 7, 22, 0.25);
  --shadow-lift: 0 20px 45px -18px rgba(58, 7, 22, 0.35);

  --ease: cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-body);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  color: var(--maroon-900);
  margin: 0 0 0.5em;
}
h1 { font-size: var(--step-h1); }
h2 { font-size: var(--step-h2); }
h3 { font-size: var(--step-h3); }
h4 { font-size: var(--step-h4); }

p { margin: 0 0 1em; max-width: 62ch; }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

button { font-family: var(--font-body); cursor: pointer; }

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(2.5rem, 6vw, 5.5rem); }

.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold-600);
  font-size: var(--step-lead);
  display: block;
  margin-bottom: 0.35em;
}

.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

.hairline-frame {
  border: 1px solid var(--gold-300);
  padding: clamp(1rem, 3vw, 2rem);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .15s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--maroon-900);
  color: var(--ivory);
}
.btn-primary:hover { background: var(--maroon-800); }
.btn-outline {
  background: transparent;
  color: var(--maroon-900);
  border-color: var(--maroon-900);
}
.btn-outline:hover { background: var(--maroon-900); color: var(--ivory); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-600));
  color: var(--maroon-950);
}
.btn-gold:hover { filter: brightness(1.05); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.82rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Forms ---- */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(184,137,79,0.15);
}
.field-error { color: var(--danger); font-size: 0.8rem; margin-top: 0.3rem; display: none; }
.field.has-error input { border-color: var(--danger); }
.field.has-error .field-error { display: block; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.grid { display: grid; gap: var(--gutter); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}
.badge {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 0.25em 0.7em;
  border-radius: 999px;
  background: var(--maroon-900);
  color: var(--ivory);
}
.badge-gold { background: var(--gold-500); color: var(--maroon-950); }
.badge-outline { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }

/* ---- Skeleton / loading ---- */
.skeleton {
  background: linear-gradient(90deg, var(--ivory-deep) 25%, #ece1cc 37%, var(--ivory-deep) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---- Toasts ---- */
#toast-region {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(90vw, 360px);
}
.toast {
  background: var(--maroon-950);
  color: var(--ivory);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toast-in .3s var(--ease);
}
.toast.toast-error { background: var(--danger); }
.toast.toast-success { background: var(--success); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 780px) {
  :root {
    --step-h1: 2.4rem;
    --step-h2: 1.9rem;
    --step-h3: 1.5rem;
  }
}
