/* ═══════════════════════════════════════════════════════════════
   Ivory & Vine — Design System Base
   Shared across: landing, draft form, preview, admin, customer
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  /* Colours */
  --iv-ivory:      #FBF9F5;
  --iv-cream:      #F4F0EA;
  --iv-surface:    #F4F0EA;
  --iv-gold:       #C2A360;
  --iv-gold-light: #D4BC7A;
  --iv-gold-soft:  rgba(194,163,96,.12);
  --iv-gold-d:     #A8895A;
  --iv-vine:       #8FA888;
  --iv-dark:       #3D3428;
  --iv-text:       #3D3428;
  --iv-muted:      #9B8E7A;
  --iv-border:     #E8E0D4;
  --iv-error:      #C05040;
  --iv-success:    #4A8C6A;

  /* Typography */
  --iv-font-h: 'Playfair Display', Georgia, serif;
  --iv-font-s: 'Lora', Georgia, serif;
  --iv-font-b: 'Josefin Sans', sans-serif;

  /* Spacing */
  --iv-radius:     12px;
  --iv-radius-lg:  20px;
  --iv-radius-pill:50px;
  --iv-shadow:     0 4px 32px rgba(61,52,40,.06);
  --iv-shadow-md:  0 8px 40px rgba(61,52,40,.10);

  /* Ease */
  --iv-ease: cubic-bezier(.16,1,.3,1);
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--iv-ivory);
  color: var(--iv-text);
  font-family: var(--iv-font-b);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
input, textarea, select, button { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ── Logo ────────────────────────────────────────────────────── */
.iv-logo {
  font-family: var(--iv-font-h);
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--iv-dark);
  text-transform: uppercase;
  font-weight: 400;
  text-decoration: none;
}
.iv-logo span { color: var(--iv-gold); font-style: italic; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 13px 28px;
  border-radius: var(--iv-radius-pill);
  font-family: var(--iv-font-b);
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all .25s var(--iv-ease);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--iv-gold);
  color: #fff;
  box-shadow: 0 6px 24px rgba(194,163,96,.2);
}
.btn-primary:hover {
  background: var(--iv-gold-d);
  transform: translateY(-1px);
  box-shadow: 0 10px 32px rgba(194,163,96,.28);
}
.btn-secondary {
  background: transparent;
  color: var(--iv-gold-d);
  border: 1px solid rgba(194,163,96,.45);
}
.btn-secondary:hover {
  border-color: var(--iv-gold);
  background: var(--iv-gold-soft);
  color: var(--iv-gold-d);
}
.btn-ghost {
  background: transparent;
  color: var(--iv-muted);
  border: 1px solid var(--iv-border);
}
.btn-ghost:hover {
  border-color: var(--iv-gold);
  color: var(--iv-dark);
}
.btn-danger {
  background: transparent;
  color: var(--iv-error);
  border: 1px solid rgba(192,80,64,.35);
}
.btn-danger:hover {
  background: rgba(192,80,64,.06);
}
.btn-sm { min-height: 36px; padding: 8px 18px; font-size: .58rem; }
.btn-lg { min-height: 56px; padding: 16px 40px; font-size: .7rem; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--iv-border);
  border-radius: var(--iv-radius);
  padding: 24px;
}
.card-lg { padding: 36px; }
.card-hover {
  transition: box-shadow .3s var(--iv-ease), transform .3s var(--iv-ease);
}
.card-hover:hover {
  box-shadow: var(--iv-shadow-md);
  transform: translateY(-2px);
}
.panel {
  background: var(--iv-cream);
  border: 1px solid var(--iv-border);
  border-radius: var(--iv-radius);
  padding: 20px;
}

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--iv-radius-pill);
  font-family: var(--iv-font-b);
  font-size: .55rem;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.badge-gold    { background: var(--iv-gold-soft);   color: var(--iv-gold-d); }
.badge-green   { background: rgba(74,140,106,.10);  color: #3A7A56; }
.badge-blue    { background: rgba(74,110,168,.10);  color: #3A5A98; }
.badge-red     { background: rgba(192,80,64,.10);   color: var(--iv-error); }
.badge-grey    { background: rgba(155,142,122,.12); color: var(--iv-muted); }
.badge-dark    { background: var(--iv-dark);        color: #fff; }

/* ── Form fields ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label,
.field-label {
  font-family: var(--iv-font-b);
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--iv-dark);
}
.field-hint {
  font-size: .75rem;
  color: var(--iv-muted);
  line-height: 1.5;
  margin-top: -2px;
}
.field-error {
  font-size: .75rem;
  color: var(--iv-error);
}
.input,
.select,
.textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--iv-border);
  border-radius: var(--iv-radius);
  background: #fff;
  font-family: var(--iv-font-b);
  font-size: .88rem;
  color: var(--iv-dark);
  transition: border-color .2s;
  outline: none;
  appearance: none;
}
.input:focus,
.select:focus,
.textarea:focus { border-color: var(--iv-gold); }
.input.error,
.select.error,
.textarea.error { border-color: var(--iv-error); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.65; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Notices ─────────────────────────────────────────────────── */
.notice {
  padding: 14px 18px;
  border-radius: var(--iv-radius);
  font-size: .82rem;
  line-height: 1.6;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notice-info    { background: rgba(74,110,168,.08); color: #2A4A88; border: 1px solid rgba(74,110,168,.18); }
.notice-success { background: rgba(74,140,106,.08); color: #2A6A46; border: 1px solid rgba(74,140,106,.18); }
.notice-warning { background: rgba(194,163,96,.10); color: var(--iv-gold-d); border: 1px solid rgba(194,163,96,.25); }
.notice-error   { background: rgba(192,80,64,.08);  color: var(--iv-error);  border: 1px solid rgba(192,80,64,.18); }
.notice-sample  {
  background: rgba(143,168,136,.10);
  color: #4A6A48;
  border: 1px dashed rgba(143,168,136,.45);
  font-size: .78rem;
}

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--iv-radius); border: 1px solid var(--iv-border); }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th {
  font-family: var(--iv-font-b);
  font-size: .58rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--iv-muted);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--iv-border);
  white-space: nowrap;
  background: var(--iv-cream);
}
td {
  padding: 12px 16px;
  color: var(--iv-text);
  border-bottom: 1px solid var(--iv-border);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--iv-ivory); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--iv-muted);
}
.empty-state-icon { font-size: 2rem; opacity: .35; margin-bottom: 12px; }
.empty-state-title { font-family: var(--iv-font-h); font-size: 1.1rem; color: var(--iv-dark); margin-bottom: 6px; }
.empty-state-text  { font-size: .85rem; line-height: 1.6; max-width: 360px; margin: 0 auto; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(61,52,40,.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--iv-radius-lg);
  padding: 36px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(61,52,40,.18);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--iv-border);
}
.modal-title { font-family: var(--iv-font-h); font-size: 1.2rem; color: var(--iv-dark); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--iv-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--iv-muted);
  transition: all .2s; cursor: pointer; background: none;
}
.modal-close:hover { border-color: var(--iv-gold); color: var(--iv-dark); }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--iv-border); }
.tab-btn {
  padding: 11px 18px;
  font-family: var(--iv-font-b);
  font-size: .6rem;
  font-weight: 400;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--iv-muted);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--iv-dark); }
.tab-btn.active { color: var(--iv-gold-d); border-bottom-color: var(--iv-gold); }
.tab-panel { display: none; padding-top: 20px; }
.tab-panel.active { display: block; }

/* ── Stepper ─────────────────────────────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
}
.stepper-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--iv-font-b);
  font-size: .58rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--iv-muted);
}
.stepper-step.active { color: var(--iv-dark); }
.stepper-step.done   { color: var(--iv-gold-d); }
.stepper-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--iv-border);
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 500;
  flex-shrink: 0;
  transition: all .3s;
}
.stepper-step.active .stepper-num { border-color: var(--iv-gold); color: var(--iv-gold-d); background: var(--iv-gold-soft); }
.stepper-step.done   .stepper-num { border-color: var(--iv-gold); background: var(--iv-gold); color: #fff; }
.stepper-line { flex: 1; height: 1px; background: var(--iv-border); min-width: 20px; }

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--iv-border);
  border-top-color: var(--iv-gold);
  border-radius: 50%;
  animation: iv-spin .7s linear infinite;
}
@keyframes iv-spin { to { transform: rotate(360deg); } }

/* ── Ornament ────────────────────────────────────────────────── */
.iv-orn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 18px auto;
  color: var(--iv-gold);
  font-size: .65rem;
  letter-spacing: .12em;
}
.iv-orn::before,
.iv-orn::after {
  content: '';
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(194,163,96,.4), transparent);
}

/* ── Responsive helpers ──────────────────────────────────────── */
@media (max-width: 768px) {
  .input-row { grid-template-columns: 1fr; }
  .modal { padding: 24px 20px; }
}
