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

:root {
  --cream:   #f8f4ed;
  --sand:    #e8dcc8;
  --terracotta: #c0533a;
  --dark:    #1a1410;
  --mid:     #4a3f35;
  --light:   #7a6d62;
  --red:     #b94030;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'Lato', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--dark);
  font-size: 17px;
  line-height: 1.7;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--dark);
  margin-bottom: 12px;
}

.section-sub {
  color: var(--light);
  margin-bottom: 40px;
  font-size: 1rem;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--terracotta);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 36px;
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--red); }

.btn-reward {
  display: block;
  margin-top: auto;
  text-align: center;
  background: transparent;
  border: 2px solid var(--terracotta);
  color: var(--terracotta);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.btn-reward:hover {
  background: var(--terracotta);
  color: #fff;
}

.reward-featured .btn-reward {
  background: var(--terracotta);
  color: #fff;
}
.reward-featured .btn-reward:hover { background: var(--red); border-color: var(--red); }

/* ── HERO ── */
.hero {
  min-height: 90vh;
  background: url('hero-bg.png') center center / cover no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  padding: 80px 40px;
  flex-wrap: wrap;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(20, 12, 8, 0.35);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: var(--cream);
  max-width: 440px;
}

.hero-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 16px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 8vw, 6rem);
  line-height: 1;
  color: #fff;
  margin-bottom: 8px;
}

.hero-author {
  font-size: 1rem;
  color: var(--sand);
  margin-bottom: 24px;
  letter-spacing: 0.05em;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--sand);
  margin-bottom: 40px;
}

.hero-book {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.book-cover {
  width: 300px;
  max-width: 80vw;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  display: block;
}

/* ── SYNOPSIS ── */
.synopsis {
  padding: 80px 0;
  background: var(--cream);
}

.synopsis .container { max-width: 720px; }

.synopsis-lead {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--mid);
  margin-bottom: 24px;
}

.synopsis p {
  margin-bottom: 18px;
  color: var(--mid);
}

.synopsis blockquote {
  border-left: 3px solid var(--terracotta);
  padding: 16px 24px;
  margin: 28px 0;
  font-style: italic;
  color: var(--mid);
  background: var(--sand);
  border-radius: 0 4px 4px 0;
}

/* ── MILESTONES ── */
.milestones {
  padding: 80px 0;
  background: var(--sand);
}

.milestones-intro {
  color: var(--mid);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 720px;
}

.milestone-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.milestone {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.milestone-last { border-bottom: none; }

.milestone-nb {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--terracotta);
  min-width: 60px;
  text-align: right;
  flex-shrink: 0;
}

.milestone-text {
  font-size: 1rem;
  color: var(--mid);
}

/* ── COUNTDOWN ── */
.countdown-section {
  padding: 60px 0;
  background: var(--dark);
  text-align: center;
}

.countdown-label {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 24px;
}

.countdown-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.countdown-nb {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.countdown-txt {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light);
  margin-top: 6px;
}

.countdown-sep {
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--terracotta);
  line-height: 1;
  margin-bottom: 20px;
}

/* ── EXTRAIT ── */
.extrait-section {
  background: #1a1410;
  padding: 64px 24px;
  text-align: center;
}
.extrait-section .container { max-width: 560px; margin: 0 auto; }
.extrait-teaser {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: #c8a97a;
  font-size: 1.05rem;
  margin: 0 0 10px;
}
.extrait-title {
  font-family: 'Playfair Display', serif;
  color: #f8f4ed;
  font-size: 2rem;
  margin: 0 0 16px;
}
.extrait-sub {
  color: #b0a090;
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 32px;
}
.extrait-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.extrait-form input {
  padding: 13px 16px;
  border: 1px solid #3a2e24;
  border-radius: 5px;
  background: #2a1f18;
  color: #f8f4ed;
  font-size: 1rem;
  font-family: 'Lato', sans-serif;
}
.extrait-form input::placeholder { color: #7a6d62; }
.extrait-form input:focus { outline: none; border-color: #c0533a; }
.extrait-form button {
  background: #c0533a;
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Lato', sans-serif;
  cursor: pointer;
  transition: background .2s;
}
.extrait-form button:hover { background: #b94030; }
#extrait-msg {
  margin-top: 16px;
  font-size: .95rem;
  color: #c8a97a;
}

/* ── PROGRESS ── */
.progress-section {
  padding: 60px 0;
  background: var(--sand);
}

.progress-section .container { max-width: 720px; }

.progress-goal {
  font-size: 1rem;
  color: var(--mid);
  margin-bottom: 12px;
  text-align: right;
}

.progress-bar-wrap {
  width: 100%;
  height: 14px;
  background: rgba(0,0,0,0.1);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--terracotta);
  border-radius: 99px;
  width: 0%;
  transition: width 1.2s ease;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  color: var(--dark);
  margin-bottom: 10px;
}

.progress-note {
  font-size: 0.78rem;
  color: var(--light);
  text-align: center;
  margin-top: 8px;
}

/* ── REWARDS ── */
.rewards {
  padding: 80px 0;
  background: var(--cream);
}

.rewards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.reward-card {
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: 8px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.reward-featured {
  border: 2px solid var(--terracotta);
  box-shadow: 0 4px 24px rgba(192, 83, 58, 0.12);
}

.reward-price {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--terracotta);
}

.reward-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--dark);
  color: var(--cream);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}

.reward-card h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--dark);
}

.reward-card p {
  font-size: 0.93rem;
  color: var(--light);
  flex: 1;
}

.reward-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 4px;
}

/* ── AUTHOR ── */
.author {
  padding: 80px 0;
  background: var(--dark);
  color: var(--cream);
}

.author h2 {
  font-family: var(--font-serif);
  color: #fff;
  margin-bottom: 32px;
}

.author-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.author-photo-placeholder {
  width: 100%;
  height: 260px;
  background: rgba(255,255,255,0.06);
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.author-photo {
  width: 100%;
  height: clamp(500px, 60vh, 700px);
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.author-text p {
  color: var(--sand);
  font-size: 1rem;
  margin-bottom: 14px;
}

.author-text p:last-child { margin-bottom: 0; }

.author p { color: var(--sand); font-size: 1rem; }

/* ── FOOTER ── */
footer {
  background: #0e0b09;
  color: var(--light);
  text-align: center;
  padding: 28px;
  font-size: 0.85rem;
}
footer a { color: var(--sand); text-decoration: none; }
footer a:hover { color: #fff; }
.footer-cookies { color: #5a5048; font-size: .78rem; margin-top: 12px; }

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 14px;
}

.footer-socials a {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  color: var(--sand);
  transition: color 0.2s;
}
.footer-socials a:hover { color: #fff; }

/* ── PAYMENT PAGE ── */
.payment-wrapper {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 24px;
}

.payment-box {
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: 10px;
  padding: 44px 48px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.06);
}

.payment-box h1 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.payment-tier-name {
  font-size: 0.9rem;
  color: var(--light);
  margin-bottom: 32px;
}

.payment-amount {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--terracotta);
  margin-bottom: 32px;
}

.payment-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border: 1px solid var(--sand);
  border-radius: 6px;
  overflow: hidden;
}

.tab-btn {
  flex: 1;
  padding: 11px;
  border: none;
  background: #fff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--mid);
  transition: background 0.2s, color 0.2s;
}

.tab-btn.active {
  background: var(--terracotta);
  color: #fff;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--mid);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--sand);
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--dark);
  background: var(--cream);
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--terracotta);
}

#card-element {
  padding: 12px 14px;
  border: 1px solid var(--sand);
  border-radius: 5px;
  background: var(--cream);
  transition: border-color 0.2s;
}
#card-element.focused { border-color: var(--terracotta); }

.btn-pay {
  width: 100%;
  background: var(--terracotta);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
}
.btn-pay:hover { background: var(--red); }
.btn-pay:disabled { background: var(--light); cursor: not-allowed; }

.payment-error {
  color: #c0392b;
  font-size: 0.9rem;
  margin-top: 12px;
  display: none;
}

.virement-info {
  background: var(--sand);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.virement-info p {
  font-size: 0.95rem;
  color: var(--mid);
  margin-bottom: 8px;
}

.virement-iban {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: 0.05em;
  background: #fff;
  padding: 10px 14px;
  border-radius: 4px;
  margin: 10px 0;
  display: block;
}

.virement-ref {
  font-size: 0.85rem;
  color: var(--light);
  margin-top: 12px;
}

.secure-badge {
  text-align: center;
  font-size: 0.8rem;
  color: var(--light);
  margin-top: 20px;
}

.back-link {
  display: inline-block;
  color: var(--terracotta);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 28px;
}
.back-link:hover { text-decoration: underline; }

/* ── SUCCESS PAGE ── */
.success-box {
  text-align: center;
  padding: 60px 48px;
}
.success-icon { font-size: 3rem; margin-bottom: 16px; }
.success-box h1 { font-family: var(--font-serif); margin-bottom: 12px; }
.success-box p { color: var(--mid); margin-bottom: 8px; }

/* ── QTY CONTROL (cartes produits) ── */
.qty-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 2px solid var(--terracotta);
  border-radius: 4px;
  overflow: hidden;
  margin-top: auto;
}

.qty-btn {
  background: transparent;
  border: none;
  color: var(--terracotta);
  font-size: 1.3rem;
  font-weight: 700;
  width: 40px;
  height: 42px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  flex-shrink: 0;
}
.qty-btn:hover:not(:disabled) {
  background: var(--terracotta);
  color: #fff;
}
.qty-btn:disabled {
  color: var(--sand);
  cursor: default;
}

.qty-val {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--dark);
  min-width: 32px;
  background: #fff;
  line-height: 42px;
}

.reward-featured .qty-control {
  border-color: var(--terracotta);
}

/* ── CART SUMMARY (page paiement) ── */
.cart-summary {
  margin-bottom: 28px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--sand);
  font-size: 0.95rem;
  color: var(--mid);
}
.cart-summary-row:last-of-type { border-bottom: none; }
.cart-summary-qty {
  font-size: 0.82rem;
  color: var(--light);
  margin-left: 6px;
}
.cart-summary-price {
  font-weight: 700;
  color: var(--dark);
  white-space: nowrap;
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0 0;
  border-top: 2px solid var(--sand);
  margin-top: 8px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--dark);
}
.cart-summary-total-amount {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--terracotta);
}

.cart-empty-msg {
  text-align: center;
  color: var(--light);
  padding: 24px 0;
  font-style: italic;
}

/* ── CART BAR (sticky bottom) ── */
.cart-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--dark);
  color: #fff;
  z-index: 1000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
.cart-bar.cart-bar-visible {
  transform: translateY(0);
}

.cart-bar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cart-bar-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.cart-bar-items {
  flex: 1;
  font-size: 0.88rem;
  color: var(--sand);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cart-item {
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.cart-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.cart-bar-total {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--terracotta);
  white-space: nowrap;
}

.cart-bar-btn {
  display: inline-block;
  background: var(--terracotta);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px 22px;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}
.cart-bar-btn:hover { background: var(--red); }

.cart-bar-clear {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.55);
  font-size: 0.95rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.cart-bar-clear:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .hero { padding: 60px 24px; gap: 40px; }
  .hero h1 { font-size: 4rem; }
  .payment-box { padding: 32px 24px; }
  .rewards-grid { grid-template-columns: 1fr; }
}
