/* ─── Paleta Frecuencia Origen ─────────────────────────────────────── */
:root {
  --bg:           #f7efde;
  --bg-card:      #faf3e6;
  --bg-card-alt:  #f0e3c4;
  --fg:           #1a1815;
  --fg-soft:      #5c544a;
  --muted:        #948775;
  --gold:         #a8862e;
  --gold-soft:    #d8b865;
  --gold-bg:      rgba(168, 134, 46, 0.12);
  --gold-border:  rgba(168, 134, 46, 0.32);
  --border:       rgba(60, 50, 30, 0.12);
  --black:        #1a1a1a;
  --danger:       #b3261e;
  --radius:       14px;
}

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

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 560px;
  margin: 56px auto 80px;
  padding: 0 24px;
}
.container.wide { max-width: 1100px; }

h1, h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
h1 { font-size: 38px; line-height: 1.15; margin-bottom: 6px; }
@media (min-width: 768px) {
  h1 { font-size: 34px; }
}
h2 { font-size: 24px; }
.subtitle { color: var(--fg-soft); font-size: 15px; margin-bottom: 36px; }

/* ─── Wordmark de marca ──────────────────────────────────────────── */
.brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 44px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.005em;
  margin-bottom: 28px;
  user-select: none;
}
.brand .frecuencia { color: var(--fg); font-style: normal; }
.brand .origen    { color: var(--gold); font-style: italic; margin-left: 6px; }
.brand.sm { font-size: 28px; margin-bottom: 22px; }
.brand a { text-decoration: none; color: inherit; }

/* ─── Chip de plan / contexto ─────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.chip .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
}

/* ─── Card ─────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 20px;
}

.plan-summary {
  margin-top: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.plan-summary .name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
}
.plan-summary .prices {
  margin-top: 8px;
  color: var(--fg-soft);
  font-size: 14px;
}
.plan-summary .prices strong { color: var(--fg); font-weight: 600; }

/* ─── Form ────────────────────────────────────────────────────────── */
label {
  display: block;
  font-weight: 500;
  margin: 18px 0 6px;
  font-size: 13px;
  color: var(--fg-soft);
  letter-spacing: 0.01em;
}
label .muted { color: var(--muted); font-weight: 400; }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: white;
  font-family: inherit;
  color: var(--fg);
  transition: border-color 0.15s;
}
input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-bg);
}

/* ─── Procesador (radio cards) ────────────────────────────────────── */
.processor-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.processor-option {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  background: white;
  transition: all 0.15s;
}
.processor-option:hover { border-color: var(--gold-soft); }
.processor-option.selected {
  border-color: var(--gold);
  background: var(--gold-bg);
}
.processor-option .name {
  font-weight: 600;
  font-size: 14px;
}
.processor-option .currency {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

/* ─── Botón CTA ───────────────────────────────────────────────────── */
button.primary {
  background: var(--black);
  color: white;
  border: none;
  padding: 15px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 28px;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: opacity 0.15s, transform 0.05s;
}
button.primary:hover { opacity: 0.88; }
button.primary:active { transform: translateY(1px); }
button.primary:disabled { opacity: 0.45; cursor: not-allowed; }

button.secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
button.secondary:hover { border-color: var(--gold-soft); }
button.secondary.danger { color: var(--danger); border-color: rgba(179, 38, 30, 0.32); }

.cta-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Alerts ──────────────────────────────────────────────────────── */
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-top: 18px;
  font-size: 14px;
  border: 1px solid transparent;
}
.alert.error { background: rgba(179, 38, 30, 0.08); border-color: rgba(179, 38, 30, 0.2); color: var(--danger); }
.alert.info  { background: var(--gold-bg); border-color: var(--gold-border); color: var(--gold); }
.alert.success { background: rgba(58, 122, 88, 0.1); border-color: rgba(58, 122, 88, 0.25); color: #2e6045; }

/* ─── Availability counter ───────────────────────────────────────── */
.availability {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--fg-soft);
}
.availability .count {
  color: var(--gold);
  font-weight: 600;
}

/* ─── Admin panel ─────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: var(--bg-card); font-weight: 600; color: var(--fg-soft); text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }
tr:last-child td { border-bottom: none; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge.active { background: rgba(58, 122, 88, 0.12); color: #2e6045; }
.badge.pending { background: var(--gold-bg); color: var(--gold); }
.badge.cancelled, .badge.expired { background: rgba(0,0,0,0.05); color: var(--muted); }
.badge.past_due, .badge.paused { background: rgba(179, 38, 30, 0.1); color: var(--danger); }
.muted { color: var(--muted); }

.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 24px; }

/* ─── Stats tiles ────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
@media (max-width: 880px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .stats-grid { grid-template-columns: 1fr; }
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat .stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin-bottom: 10px;
}
.stat .stat-value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--fg);
}
.stat .stat-value .small { font-size: 18px; color: var(--fg-soft); font-weight: 500; }
.stat .stat-value .gold  { color: var(--gold); font-style: italic; }
.stat .stat-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.stat .stat-sub.up    { color: #2e6045; }
.stat .stat-sub.down  { color: var(--danger); }

.stat.highlight { background: var(--gold-bg); border-color: var(--gold-border); }
.stat.warn { background: rgba(179, 38, 30, 0.06); border-color: rgba(179, 38, 30, 0.2); }

/* ─── Lista de próximos a vencer ─────────────────────────────────── */
.expiring-list {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 4px;
  margin-bottom: 28px;
}
.expiring-list .expiring-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.expiring-list .expiring-row:last-child { border-bottom: none; }
.expiring-list .expiring-empty {
  padding: 18px 16px;
  color: var(--muted);
  font-size: 14px;
}
.expiring-list .date { color: var(--gold); font-weight: 600; }

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin: 0 0 10px 4px;
}

/* ─── Status + boleta de pago (página de gracias) ────────────────── */
.status-block {
  text-align: center;
  padding: 4px 0 14px 0;
}
.status-block .status-msg {
  font-size: 15px;
  color: var(--fg-soft);
}
.status-block.active .status-msg {
  color: #2e6045;
  font-weight: 500;
}
.status-block .check {
  display: inline-block;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(58, 122, 88, 0.12);
  color: #2e6045;
  font-size: 20px;
  line-height: 38px;
  text-align: center;
  margin-bottom: 10px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.4s, transform 0.4s;
}
.status-block.active .check { opacity: 1; transform: scale(1); }

.payment-receipt {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.4s, max-height 0.4s;
}
.payment-receipt.show {
  opacity: 1;
  max-height: 400px;
}
.payment-receipt .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  margin-bottom: 0;
}
.payment-receipt .row .label { color: var(--muted); font-size: 13px; }
.payment-receipt .row .value { font-size: 14px; font-weight: 500; color: var(--fg); }

/* ─── Footer de marca ────────────────────────────────────────────── */
.brand-footer {
  text-align: center;
  margin: 72px auto 40px;
  font-family: 'Inter', sans-serif;
  color: var(--fg-soft);
  user-select: none;
}
.brand-footer .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  margin-bottom: 20px;
}
.brand-footer .names {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg);
  margin-bottom: 4px;
}
.brand-footer .product {
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.toolbar select {
  padding: 7px 12px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 999px;
  background: white; font-family: inherit;
}

/* ─── Sold out / empty states ─────────────────────────────────────── */
.sold-out {
  text-align: center;
  padding: 40px 20px;
}
.sold-out h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  margin-bottom: 12px;
}
.sold-out p { color: var(--fg-soft); }

/* ─── Hint / small print ─────────────────────────────────────────── */
.hint {
  margin-top: 24px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.hint a { color: var(--gold); text-decoration: none; }
.hint a:hover { text-decoration: underline; }

/* ─── Skeleton loader ─────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 0%, rgba(0,0,0,0.04) 50%, var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
