:root {
  --bg: #F8FAFC;
  --primary: #255255;
  --secondary: #852E4A;
  --action: #7D142F;
  --text: #111111;
  --subtext: #6B7280;
  --border: #E2E8F0;
  --white: #ffffff;
  --open: #059669;
  --open-bg: #ECFDF5;
  --soon: #D97706;
  --soon-bg: #FFFBEB;
  --closed: #6B7280;
  --closed-bg: #F3F4F6;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  background: var(--primary);
  padding: 0 48px;
  height: 60px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

.nav-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  letter-spacing: -0.3px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-dot {
  width: 8px;
  height: 8px;
  background: var(--action);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Platform nav links */
.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
}

.nav-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-user-email {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-logout:hover { background: rgba(255,255,255,0.18); }

/* Landing nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-nav-ghost {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.25);
  transition: background 0.15s;
}
.btn-nav-ghost:hover { background: rgba(255,255,255,0.1); color:#fff; }

.btn-nav-solid {
  background: var(--action);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 7px;
  transition: background 0.15s;
}
.btn-nav-solid:hover { background: #6a1027; }

/* ── LAYOUT ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.page-header p {
  font-size: 14px;
  color: var(--subtext);
}

/* ── BUTTONS ── */
.btn-primary {
  background: var(--action);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-primary:hover { background: #6a1027; }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.btn-secondary:hover { border-color: var(--primary); background: #eef4f4; }

/* ── STATUS BADGES ── */
.badge-open, .badge-soon, .badge-closed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-open   { background: var(--open-bg);   color: var(--open); }
.badge-soon   { background: var(--soon-bg);   color: var(--soon); }
.badge-closed { background: var(--closed-bg); color: var(--closed); }

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── PROMO LAYOUT ── */
.promo-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

.promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 16px;
}

/* ── PROMO CARD ── */
.promo-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.promo-card:hover {
  box-shadow: 0 6px 24px rgba(37,82,85,0.1);
  transform: translateY(-2px);
}

.promo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.promo-card-location {
  font-size: 11px;
  color: var(--subtext);
  font-weight: 500;
  text-align: right;
}

.promo-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}

.promo-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  color: var(--subtext);
  font-weight: 500;
  padding: 3px 10px;
}

.promo-card-deadline {
  font-size: 12px;
  color: var(--subtext);
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.promo-card-deadline strong { color: var(--text); }

/* ── FILTERS SIDEBAR ── */
.filters {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: sticky;
  top: 80px;
}

.filter-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--subtext);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

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

.filter-group > label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}

.filter-group select,
.filter-group input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
}
.filter-group select:focus,
.filter-group input[type="text"]:focus { border-color: var(--primary); }

.filter-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  font-weight: 400;
}

.filter-checks input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
}

/* ── PROVINCE GRID ── */
.province-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.province-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.province-card:hover {
  box-shadow: 0 6px 24px rgba(37,82,85,0.1);
  transform: translateY(-2px);
}

.province-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.province-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.province-count {
  font-size: 12px;
  color: var(--subtext);
}
.province-count strong { color: var(--open); font-weight: 700; }

/* ── FORMS (login, calculadora) ── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.input-group input,
.input-group select {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  appearance: none;
}
.input-group input::placeholder { color: #A0AEC0; }
.input-group input:focus,
.input-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,82,85,0.1);
}

.form-btn {
  width: 100%;
  background: var(--action);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 13px;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}
.form-btn:hover { background: #6a1027; }

/* ── AUTH / LOGIN ── */
.auth-wrap {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(37,82,85,0.07);
}

.auth-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13px;
  color: var(--subtext);
  margin-bottom: 24px;
}

.tab-switcher {
  display: flex;
  background: var(--bg);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 24px;
  gap: 3px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--subtext);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab-btn.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-note {
  font-size: 11px;
  color: #9CA3AF;
  text-align: center;
  margin-top: 12px;
}

/* ── COMO FUNCIONA ── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 8px;
}

.step-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  text-align: center;
}

.step-number {
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.step-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.step-card p {
  font-size: 14px;
  color: var(--subtext);
  line-height: 1.6;
}

/* ── DETALLE ── */
.detalle-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

.detalle-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detalle-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.detalle-section h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.req-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.req-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.req-icon {
  color: var(--primary);
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.detalle-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 80px;
}

.sidebar-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.sidebar-card h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.sidebar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.sidebar-row:last-child { border-bottom: none; }
.sidebar-row span:first-child { color: var(--subtext); }
.sidebar-row span:last-child { font-weight: 600; color: var(--text); }

.countdown {
  background: #FFF8F0;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
  margin-top: 4px;
}
.countdown-label { font-size: 11px; color: var(--soon); font-weight: 600; text-transform: uppercase; }
.countdown-days { font-size: 28px; font-weight: 800; color: var(--soon); }
.countdown-sub { font-size: 12px; color: var(--subtext); }

/* ── RESULT BOX (calculadora) ── */
.result-box {
  background: var(--open-bg);
  border: 1px solid #A7F3D0;
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
  display: none;
}
.result-box.show { display: block; }
.result-box h3 { font-size: 16px; font-weight: 700; color: var(--open); margin-bottom: 8px; }
.result-box p { font-size: 14px; color: #065F46; line-height: 1.6; }

/* ── GATE OVERLAY (páginas con acceso restringido) ── */
.promo-gate { position: relative; min-height: 320px; }

.promo-gate.locked #promo-grid {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}

.gate-overlay {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.promo-gate.locked .gate-overlay { display: flex; }

.gate-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  max-width: 340px;
  box-shadow: 0 8px 40px rgba(37,82,85,0.16);
}

.gate-icon { font-size: 34px; margin-bottom: 12px; }

.gate-card h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.gate-card p {
  font-size: 13px;
  color: var(--subtext);
  line-height: 1.65;
  margin-bottom: 20px;
}

.gate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Province card locked state */
.province-card.locked {
  cursor: default;
  opacity: 0.85;
}

.province-card.locked:hover {
  transform: none;
  box-shadow: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .promo-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .detalle-layout { grid-template-columns: 1fr; }
  .detalle-sidebar { position: static; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  nav {
    height: auto;
    padding: 0 16px;
    flex-wrap: wrap;
  }

  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 0 0;
    gap: 0;
    align-items: center;
  }

  .nav-links {
    display: flex;
    order: 3;
    width: 100%;
    flex-basis: 100%;
    flex: none;
    padding: 6px 0 8px;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 0;
  }

  .nav-links::-webkit-scrollbar { display: none; }

  .nav-links a {
    font-size: 13px;
    padding: 5px 11px;
    white-space: nowrap;
  }

  .nav-actions, .nav-user {
    order: 2;
    margin-left: auto;
    padding-bottom: 8px;
  }

  .nav-user-email { display: none; }
  .container { padding: 24px 16px; }
  .province-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 28px 20px; }
}
