/* ============================================
   AUTH MODAL + USER PANEL + HOW SECTION
   + UI IMPROVEMENTS
   ============================================ */

/* ── TOKEN ALIASES (compat con styles.css) ── */
:root{
  --primary:       var(--forest);
  --primary-dark:  var(--forest-mid);
  --primary-light: var(--sage-light);
  --secondary:     var(--sage);
  --accent:        var(--gold);
  --bg:            var(--ivory);
  --bg-alt:        var(--cream);
  --text-muted:    var(--text-dim);
  --wa-green:      var(--wa);
  --success:       #16a34a;
}

/* ── HEADER: login & user buttons ─────────── */
.login-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .4rem .85rem;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.login-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

.user-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(92,110,46,.1);
  border: 1px solid rgba(92,110,46,.3);
  border-radius: 10px;
  padding: .35rem .8rem .35rem .4rem;
  cursor: pointer;
  transition: var(--transition);
}
.user-btn:hover { background: rgba(92,110,46,.18); }
.user-btn-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: .75rem;
  display: flex; align-items: center; justify-content: center;
}
.user-btn-points { font-size: .78rem; font-weight: 700; color: var(--primary); }

/* ── MODAL OVERLAY ─────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: block; }

/* ── AUTH MODAL ────────────────────────────── */
.auth-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.94);
  width: min(440px, calc(100vw - 2rem));
  background: white;
  border-radius: 20px;
  z-index: 301;
  padding: 0;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  overflow: hidden;
}
.auth-modal.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: all;
}
.modal-close {
  position: absolute;
  top: .9rem; right: 1rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 1;
  padding: .25rem .5rem;
  border-radius: 6px;
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg-alt); }

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 1rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.auth-tab:first-child { border-radius: 20px 0 0 0; }
.auth-tab:last-child  { border-radius: 0 20px 0 0; }
.auth-tab.active { background: white; color: var(--primary); border-bottom: 2px solid var(--primary); }

.auth-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.auth-welcome { text-align: center; }
.auth-icon { font-size: 2.2rem; display: block; margin-bottom: .3rem; }
.auth-welcome p { font-size: .95rem; color: var(--text-muted); font-weight: 500; }

.loyalty-teaser {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: linear-gradient(135deg, rgba(92,110,46,.08), rgba(200,148,26,.08));
  border: 1px solid rgba(92,110,46,.2);
  border-radius: 10px;
  padding: .75rem 1rem;
  font-size: .8rem;
}
.loyalty-teaser > span { font-size: 1.5rem; flex-shrink: 0; }
.loyalty-teaser strong { display: block; color: var(--primary); font-size: .85rem; margin-bottom: .15rem; }
.loyalty-teaser small { color: var(--text-muted); line-height: 1.4; }

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}
.auth-form input {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: .65rem .9rem;
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  transition: var(--transition);
  outline: none;
  background: var(--bg);
}
.auth-form input:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(92,110,46,.12); }

.btn-auth-submit {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: .85rem;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: .25rem;
}
.btn-auth-submit:hover { background: var(--primary-dark); transform: translateY(-1px); }

.auth-switch { text-align: center; font-size: .82rem; color: var(--text-muted); }
.auth-switch button {
  background: none; border: none; color: var(--primary);
  font-weight: 700; cursor: pointer; font-size: .82rem;
  text-decoration: underline;
}
.auth-error {
  background: #FEE2E2;
  color: #991B1B;
  border-radius: 8px;
  padding: .6rem .9rem;
  font-size: .82rem;
  font-weight: 500;
}

/* ── USER PANEL ────────────────────────────── */
.user-panel {
  position: fixed;
  top: 0; right: -100%;
  width: min(400px, 100vw);
  height: 100vh;
  background: white;
  z-index: 301;
  box-shadow: var(--shadow-lg);
  transition: right .3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.user-panel.open { right: 0; }

.user-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.user-panel-info { display: flex; align-items: center; gap: .75rem; }
.user-panel-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-panel-info strong { display: block; font-size: .95rem; color: var(--text); }
.user-panel-info small { font-size: .78rem; color: var(--text-muted); }
.user-panel-header > button {
  background: none; border: none; font-size: 1.2rem;
  color: var(--text-muted); cursor: pointer; padding: .25rem .5rem; border-radius: 6px;
  transition: var(--transition);
}
.user-panel-header > button:hover { background: var(--bg-alt); }

/* POINTS CARD */
/* POINTS CARD */
.points-card {
  margin: 1.25rem 1.5rem;
  border-radius: 20px;
  padding: 1.75rem;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(30, 40, 20, 0.25);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--secondary) 100%);
}
.points-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 45%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 55%
  );
  transition: all 0.6s ease;
  transform: rotate(-15deg);
  pointer-events: none;
}
.points-card:hover::before {
  left: 100%;
  top: 100%;
}

/* Bronze Tier - metallic feel */
.points-card.bronze {
  background: linear-gradient(135deg, #4A2B14 0%, #704224 40%, #8A522E 70%, #5E351B 100%);
  box-shadow: 0 15px 35px rgba(112, 66, 36, 0.25);
}

/* Silver Tier - chrome metallic feel */
.points-card.silver {
  background: linear-gradient(135deg, #2D3748 0%, #718096 40%, #A0AEC0 70%, #4A5568 100%);
  box-shadow: 0 15px 35px rgba(113, 128, 150, 0.25);
}

/* Gold Tier - hologram gold metallic feel */
.points-card.gold {
  background: linear-gradient(135deg, #785A18 0%, #D4AF37 40%, #F3C63F 70%, #9B7A24 100%);
  box-shadow: 0 15px 35px rgba(212, 175, 55, 0.3);
}
.points-card.gold::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.08) 30%, rgba(255,255,255,0.18) 40%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0) 100%);
  background-size: 200% 200%;
  animation: shine-holo 4s infinite linear;
  pointer-events: none;
}
@keyframes shine-holo {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.points-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .5rem;
}
.points-label { font-size: .78rem; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .05em; }
.points-tier { font-size: .78rem; font-weight: 700; background: rgba(255,255,255,.15); border-radius: 100px; padding: .2rem .6rem; }
.points-value { font-size: 2.8rem; font-weight: 800; line-height: 1; margin-bottom: 1rem; }
.points-progress-wrap { margin-bottom: .5rem; }
.points-progress-bar { background: rgba(255,255,255,.2); border-radius: 100px; height: 6px; margin-bottom: .4rem; overflow: hidden; }
.points-progress-fill { height: 100%; border-radius: 100px; transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1); background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
.points-progress-wrap small { font-size: .75rem; color: rgba(255,255,255,.75); }
.points-equivalence { font-size: .82rem; color: rgba(255,255,255,.75); }
.points-equivalence strong { color: white; }

/* PANEL SECTION */
.panel-section { padding: 0 1.5rem 1rem; flex: 1; }
.panel-section h3 { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; }
.orders-list { display: flex; flex-direction: column; gap: .75rem; }
.empty-state { font-size: .85rem; color: var(--text-muted); text-align: center; padding: 1.5rem 0; }

.order-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.order-card-top { display: flex; justify-content: space-between; align-items: center; }
.order-id { font-size: .8rem; font-weight: 700; color: var(--text-muted); font-family: monospace; }
.order-status { font-size: .78rem; font-weight: 700; }
.order-products { font-size: .82rem; color: var(--text); font-weight: 500; }
.order-meta { display: flex; justify-content: space-between; font-size: .78rem; color: var(--text-muted); }
.order-meta strong { color: var(--primary); }
.order-points-earned { font-size: .75rem; color: var(--success); font-weight: 600; }

.panel-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); }
.btn-logout {
  width: 100%;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: .65rem;
  font-size: .88rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.btn-logout:hover { border-color: #EF4444; color: #EF4444; }

/* ── DARK MODE AUTH / PANEL ────────────────────── */
[data-theme="dark"] .auth-modal{background:var(--white)}
[data-theme="dark"] .auth-tab{background:var(--cream);color:var(--text-mid)}
[data-theme="dark"] .auth-tab.active{background:var(--white);color:var(--sage);border-bottom-color:var(--sage)}
[data-theme="dark"] .modal-close:hover{background:var(--cream)}
[data-theme="dark"] .loyalty-teaser{background:linear-gradient(135deg,rgba(78,154,110,.12),rgba(200,154,42,.12));border-color:rgba(78,154,110,.3)}
[data-theme="dark"] .loyalty-teaser strong{color:var(--sage-light)}
[data-theme="dark"] .auth-form input{background:var(--cream);color:var(--text);border-color:var(--border-hi)}
[data-theme="dark"] .auth-form input:focus{background:var(--cream-dark);border-color:var(--sage);box-shadow:0 0 0 3px rgba(114,184,135,.15)}
[data-theme="dark"] .btn-auth-submit{background:var(--sage)}
[data-theme="dark"] .btn-auth-submit:hover{background:var(--forest-mid)}
[data-theme="dark"] .auth-switch{color:var(--text-dim)}
[data-theme="dark"] .auth-switch button{color:var(--sage-light)}
[data-theme="dark"] .user-panel{background:var(--white)}
[data-theme="dark"] .user-panel-header{border-color:var(--border)}
[data-theme="dark"] .user-panel-header > button:hover{background:var(--cream)}
[data-theme="dark"] .panel-section h3{color:var(--text)}
[data-theme="dark"] .order-card{background:var(--cream);border-color:var(--border)}
[data-theme="dark"] .order-id{color:var(--text-dim)}
[data-theme="dark"] .order-products{color:var(--text)}
[data-theme="dark"] .panel-footer{border-color:var(--border)}
[data-theme="dark"] .btn-logout{border-color:var(--border);color:var(--text-dim)}
[data-theme="dark"] .login-btn{background:var(--cream);border-color:var(--border);color:var(--text)}
[data-theme="dark"] .login-btn:hover{background:var(--forest);color:#fff;border-color:var(--forest)}
[data-theme="dark"] .user-btn{background:rgba(78,154,110,.12);border-color:rgba(78,154,110,.3)}
[data-theme="dark"] .user-btn-points{color:var(--sage-light)}

/* ── HOW IT WORKS SECTION ──────────────────── */
.how-section { background: white; }
.how-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
@media (min-width: 768px) {
  .how-grid { flex-direction: row; align-items: flex-start; }
}
.how-step {
  flex: 1;
  text-align: center;
  padding: 1.5rem;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
  transition: var(--transition);
}
.how-step:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--primary-light); }
.how-number {
  position: absolute;
  top: -14px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 800;
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.how-icon { font-size: 2.5rem; margin-bottom: .75rem; display: block; }
.how-step h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: .5rem; }
.how-step p { font-size: .85rem; color: var(--text-muted); line-height: 1.6; }
.how-connector {
  width: 40px; height: 2px;
  background: linear-gradient(90deg, var(--primary-light), var(--accent));
  border-radius: 2px;
  flex-shrink: 0;
  display: none;
}
@media (min-width: 768px) { .how-connector { display: block; margin-top: 3rem; } }
.how-cta { text-align: center; margin-top: 2.5rem; }

/* ── UI IMPROVEMENTS ───────────────────────── */

/* Hero — smoother gradient */
.hero {
  background: linear-gradient(135deg, #111E06 0%, #1E3A0A 35%, #2E5014 65%, #1A3008 100%) !important;
}
.hero-bg {
  background:
    radial-gradient(ellipse at 15% 60%, rgba(100,160,40,.25) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 25%, rgba(168,200,80,.12) 0%, transparent 45%) !important;
}

/* Program cards — stronger hover lift */
.program-card { transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease !important; }

/* Smooth section fade-in via intersection observer */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Better product cards */
.product-card { transition: box-shadow .2s ease, transform .2s ease !important; }

/* Testimonials — slight rotation for character */
.testimonial-card:nth-child(2) { transform: translateY(-6px); }
.testimonial-card:nth-child(2):hover { transform: translateY(-10px); }

/* Footer phone */
.footer-contact .phone-link {
  display: flex; align-items: center; gap: .4rem;
  font-size: .88rem; color: rgba(255,255,255,.7);
  margin-bottom: .4rem;
}
