/* LetterLore Design System */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@400;500;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --cream: #FDF8F0;
  --ink: #1A1612;
  --burgundy: #6B2D3E;
  --gold: #C4934A;
  --sage: #8B9E7E;
  --warm-grey: #9E9589;
  --paper: #F5EDE0;
  --seal-red: #8B3A3A;
  --success: #4A7C59;
  --error: #8B3A3A;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Header ── */
.site-header {
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
}

.site-header .logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-header nav a {
  text-decoration: none;
  color: var(--warm-grey);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.site-header nav a:hover {
  color: var(--ink);
}

.site-header nav a.active {
  color: var(--burgundy);
}

/* ── Wax Seal ── */
.wax-seal {
  width: 40px;
  height: 40px;
  background: radial-gradient(circle at 40% 40%, #a04848, var(--seal-red) 50%, #6b2828);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  color: #e8c8c8;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 2px 4px 12px rgba(0,0,0,0.2), inset 0 -2px 6px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.1);
  position: relative;
  flex-shrink: 0;
}

.wax-seal::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.15);
}

.wax-seal.large {
  width: 80px;
  height: 80px;
  font-size: 28px;
}

.wax-seal.large::after {
  inset: 6px;
}

/* ── Typography ── */
h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  color: var(--ink);
}

h1 { font-size: 48px; line-height: 1.1; font-weight: 700; letter-spacing: -1px; }
h2 { font-size: 36px; line-height: 1.2; font-weight: 700; }
h3 { font-size: 22px; line-height: 1.3; font-weight: 600; }

h1 em, h2 em { font-style: italic; color: var(--burgundy); }

.subtitle {
  color: var(--warm-grey);
  font-size: 18px;
  line-height: 1.7;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--burgundy);
  color: white;
}

.btn-primary:hover {
  background: #7d3549;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(107, 45, 62, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--burgundy);
  border: 2px solid var(--burgundy);
}

.btn-secondary:hover {
  background: var(--burgundy);
  color: white;
}

.btn-gold {
  background: var(--gold);
  color: white;
}

.btn-gold:hover {
  background: #b5843b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 147, 74, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--warm-grey);
  padding: 8px 16px;
}

.btn-ghost:hover {
  color: var(--ink);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-lg {
  padding: 20px 40px;
  font-size: 18px;
  border-radius: 10px;
}

/* ── Cards ── */
.card {
  background: white;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.card-paper {
  background: var(--paper);
}

/* ── Forms ── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  border: 2px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group .hint {
  font-size: 13px;
  color: var(--warm-grey);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Page Layout ── */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px;
}

.page-hero {
  text-align: center;
  padding: 60px 0 40px;
}

.page-hero h1 {
  margin-bottom: 16px;
}

.page-hero .subtitle {
  max-width: 600px;
  margin: 0 auto;
}

/* ── Footer ── */
.site-footer {
  padding: 40px;
  text-align: center;
  color: var(--warm-grey);
  font-size: 13px;
  margin-top: 60px;
}

.site-footer a {
  color: var(--burgundy);
  text-decoration: none;
}

/* ── Alert messages ── */
.alert {
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-error {
  background: #fdf0f0;
  color: var(--error);
  border: 1px solid rgba(139, 58, 58, 0.2);
}

.alert-success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid rgba(74, 124, 89, 0.2);
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.divider-icon {
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 24px;
}

/* ── Plan toggle ── */
.plan-toggle {
  display: flex;
  background: var(--paper);
  border-radius: 10px;
  padding: 4px;
  max-width: 340px;
  margin: 0 auto 40px;
}

.plan-toggle button {
  flex: 1;
  padding: 12px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  color: var(--warm-grey);
  transition: all 0.2s;
}

.plan-toggle button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.plan-toggle .savings-badge {
  font-size: 11px;
  background: var(--sage);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}

/* ── Delivery timeline ── */
.timeline-list {
  list-style: none;
  padding: 0;
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  align-items: center;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.timeline-number.delivered {
  background: var(--sage);
  color: white;
}

.timeline-number.in_transit {
  background: var(--gold);
  color: white;
}

.timeline-number.upcoming {
  background: var(--paper);
  color: var(--warm-grey);
  border: 2px solid rgba(0,0,0,0.08);
}

.timeline-content {
  flex: 1;
}

.timeline-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.timeline-date {
  font-size: 13px;
  color: var(--warm-grey);
  margin-top: 2px;
}

.timeline-status {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 20px;
}

.status-delivered {
  background: rgba(74, 124, 89, 0.1);
  color: var(--sage);
}

.status-in_transit {
  background: rgba(196, 147, 74, 0.15);
  color: var(--gold);
}

.status-upcoming {
  background: rgba(0,0,0,0.04);
  color: var(--warm-grey);
}

/* ── Progress bar ── */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--paper);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--gold));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ── Loading ── */
.loading {
  text-align: center;
  padding: 60px 0;
  color: var(--warm-grey);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--paper);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .site-header {
    padding: 20px 24px;
    flex-wrap: wrap;
    gap: 16px;
  }

  .site-header nav {
    gap: 20px;
  }

  .page-container {
    padding: 24px;
  }

  .page-hero {
    padding: 40px 0 24px;
  }

  h1 { font-size: 32px; }
  h2 { font-size: 28px; }

  .form-row {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 24px;
  }

  .btn-lg {
    padding: 16px 28px;
    font-size: 16px;
  }
}
