/* ============================================================
   CHECKOUT PAGES — NIE Experts Spain
   Layout centered stacked: form sopra, riepilogo sotto.
   Tutto entro 1 schermata desktop 1440x900.
   ============================================================ */

:root {
  --bg: #faf3e7;
  --white: #ffffff;
  --navy-headline: #1a2744;
  --navy-soft: #2a3a5c;
  --gold: #d4a853;
  --gold-light: #e8c77b;
  --gold-bg: linear-gradient(135deg, #d4a853, #e8c77b);
  --gold-bg-soft: linear-gradient(135deg, rgba(212,168,83,0.12), rgba(232,199,123,0.08));
  --gray-warm: #6b7280;
  --gray-light: #e5e1d8;
  --gray-bg: #f5f1e8;
  --green-success: #10b981;
  --shadow-soft: 0 4px 20px rgba(26,39,68,0.06);
  --shadow-card: 0 10px 40px rgba(26,39,68,0.10);
  --radius-card: 18px;
  --radius-input: 12px;
  --radius-btn: 13px;
  --font-headline: 'Libre Baskerville', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--navy-headline);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
}

/* ===== TOP BAR ===== */
.checkout-topbar {
  background: rgba(250, 243, 231, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(26, 39, 68, 0.06);
  padding: 12px 24px;
}
.checkout-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.checkout-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--gray-warm);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.checkout-back:hover { color: var(--navy-headline); }
.checkout-back svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.checkout-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--navy-headline);
}
.checkout-logo img { width: 30px; height: 30px; }
.checkout-logo-text { font-family: var(--font-headline); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.checkout-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-warm);
  font-weight: 500;
}
.checkout-secure svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ===== LAYOUT CENTERED ===== */
.checkout-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ===== HEADER TIER ===== */
.checkout-tier-header {
  text-align: center;
  margin-bottom: 4px;
}
.checkout-tier-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--gold-bg);
  color: var(--navy-headline);
  margin-bottom: 10px;
}
.checkout-tier-badge.tier-digital { background: rgba(107, 114, 128, 0.12); color: var(--navy-headline); }
.checkout-tier-badge.tier-concierge-plus { background: linear-gradient(135deg, #1a2744, #2a3a5c); color: var(--gold); }
.checkout-tier-name {
  font-family: var(--font-headline);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}

/* Tier name em (italic gold) */
.checkout-tier-name em {
  background: linear-gradient(135deg, #d4a853, #e8c77b, #d4a853);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
  font-family: var(--font-headline);
  font-weight: 700;
}

/* "+" stilizzato per Concierge nel checkout */
.plus-sup {
  font-size: 0.55em;
  font-weight: 700;
  vertical-align: super;
  top: -0.25em;
  position: relative;
  background: linear-gradient(135deg, #d4a853, #e8c77b, #d4a853);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-left: 2px;
  font-style: normal;
}

/* ===== STEP CARD ===== */
.checkout-step {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 18px 22px 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(26, 39, 68, 0.04);
}
.checkout-step-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.checkout-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold-bg);
  color: var(--navy-headline);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.checkout-step-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--navy-headline);
}
.checkout-step-hint {
  font-size: 12.5px;
  color: var(--gray-warm);
  margin: 0 0 12px 0;
  line-height: 1.4;
}

/* ===== SELETTORE PERSONE (4 colonne) ===== */
.persons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.persons-grid.three-cols {
  grid-template-columns: repeat(3, 1fr);
}
.person-option {
  background: var(--gray-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-input);
  padding: 14px 8px 12px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.person-option:hover { background: rgba(212, 168, 83, 0.08); }
.person-option.selected {
  background: var(--white);
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(212, 168, 83, 0.18);
}
.person-option-count {
  font-family: var(--font-headline);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: var(--navy-headline);
  margin-bottom: 4px;
}
.person-option-label {
  font-size: 12px;
  color: var(--gray-warm);
  font-weight: 500;
}
.person-option-discount {
  font-size: 10.5px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-top: 4px;
  white-space: nowrap;
}
.person-option-discount-short {
  display: none;
}

/* ===== RIEPILOGO ===== */
.checkout-summary {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(26, 39, 68, 0.05);
}
.summary-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-warm);
  margin-bottom: 12px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  font-size: 13.5px;
  color: var(--navy-headline);
  border-bottom: 1px solid rgba(26, 39, 68, 0.06);
}
.summary-row:last-of-type { border-bottom: none; }
.summary-row-label { color: var(--gray-warm); }
.summary-row-value { font-weight: 600; }
.summary-row-discount {
  color: var(--green-success);
  font-weight: 700;
}
.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--navy-headline);
}
.summary-total-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy-headline);
}
.summary-total-value {
  font-family: var(--font-headline);
  font-size: 30px;
  font-weight: 700;
  color: var(--navy-headline);
  letter-spacing: -0.02em;
  line-height: 1;
}
.summary-total-currency { font-size: 19px; }

/* PER PERSONA: prezzo singolo barrato + prezzo effettivo */
.summary-perperson {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-warm);
  font-weight: 500;
}
.summary-perperson-strike {
  text-decoration: line-through;
  color: rgba(107, 114, 128, 0.7);
}
.summary-perperson-actual {
  color: var(--gold);
  font-weight: 700;
}

/* ===== CTA ===== */
.summary-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  background: var(--gold-bg);
  color: var(--navy-headline);
  font-size: 16px;
  font-weight: 700;
  border: none;
  padding: 16px 22px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.22s;
  font-family: var(--font-body);
  box-shadow: 0 6px 20px rgba(212, 168, 83, 0.3);
}
.summary-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(212, 168, 83, 0.45);
}
.summary-cta svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* ===== SCARCITY INLINE: testo libero senza box esterno, countdown in box oro ===== */
.scarcity-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--gray-warm);
  font-weight: 500;
}
.scarcity-icon-inline { display: none; } /* visibile solo su mobile via media query */
.scarcity-inline svg {
  width: 12px;
  height: 12px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 2.5;
  flex-shrink: 0;
}
.scarcity-inline strong {
  color: var(--navy-headline);
  font-weight: 700;
}

/* Box countdown gold con scritta oro + numeri navy */
.scarcity-countdown {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 3px 10px;
  background: rgba(212, 168, 83, 0.18);
  border: 1px solid rgba(212, 168, 83, 0.45);
  color: var(--gold);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}
.scarcity-countdown:empty { display: none; }
.scarcity-countdown-label {
  color: var(--gold);
  font-weight: 700;
}
.scarcity-countdown-time {
  color: var(--navy-headline);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ===== TRUST + PAYMENT ICONS ===== */
.summary-trust {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.summary-trust-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--gray-warm);
  font-weight: 500;
}
.summary-trust-item svg { width: 13px; height: 13px; stroke: var(--green-success); fill: none; stroke-width: 2.5; flex-shrink: 0; }

.summary-payment-icons {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 11px;
  border-top: 1px solid rgba(26, 39, 68, 0.06);
}
.summary-payment-icons span {
  font-size: 10.5px;
  color: var(--gray-warm);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ===== MOBILE ===== */
@media (max-width: 640px) {
  .checkout-page {
    padding: 18px 14px 28px;
    gap: 14px;
  }
  .checkout-tier-name { font-size: 24px; }
  .checkout-step { padding: 14px 16px; }
  .checkout-summary { padding: 18px 18px; }
  .checkout-topbar { padding: 10px 14px; }
  .checkout-logo-text { font-size: 14px; }
  .checkout-secure { display: none; }
  .summary-total-value { font-size: 26px; }
  /* Scarcity mobile: tutto centrato, icona inline col testo, countdown sotto centrato */
  .scarcity-inline {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  .scarcity-inline > span {
    display: block;
  }
  .scarcity-inline > svg { display: none; }
  /* Span msg con icona inline (svg messo dentro #scarcityMsg) */
  #scarcityMsg .scarcity-icon-inline {
    display: inline-block;
    width: 12px;
    height: 12px;
    vertical-align: -1px;
    margin-right: 5px;
    stroke: var(--gold);
    fill: none;
    stroke-width: 2.5;
  }
  .scarcity-countdown { margin-left: 0; margin-top: 4px; }
}

@media (max-width: 420px) {
  .persons-grid { gap: 6px; }
  .person-option { padding: 12px 4px 10px; gap: 2px; }
  .person-option-count { font-size: 20px; }
  .person-option-label { font-size: 11px; }
  .person-option-discount { display: none; }
  .person-option-discount-short {
    display: inline;
    font-size: 11px;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-top: 3px;
  }
}
