/* =============================================
   PORTAL DE PACIENTES – portal.css
   Estilos del portal de registro, login y dashboard
   ============================================= */

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

/* ── Variables (misma paleta que el sitio) ── */
:root {
  --primary:      #8B7355;
  --primary-dk:   #6B5B45;
  --primary-lt:   #F5F0E8;
  --secondary:    #C4A882;
  --accent:       #D4956A;
  --text:         #3A3028;
  --text-lt:      #7A6E64;
  --bg:           #FDFAF5;
  --white:        #FFFFFF;
  --border:       rgba(139,115,85,0.18);
  --shadow:       0 4px 24px rgba(139,115,85,0.12);
  --shadow-lg:    0 8px 40px rgba(139,115,85,0.18);
  --radius:       12px;
  --radius-lg:    20px;
  --green:        #25D366;
  --font-h:       'Playfair Display', serif;
  --font-b:       'Inter', sans-serif;
  --transition:   all 0.25s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
button { cursor: pointer; font-family: var(--font-b); }
input, select, textarea { font-family: var(--font-b); }

/* ═══════════════════════════════════════════
   LAYOUT BASE
═══════════════════════════════════════════ */
.portal_page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.portal_topbar {
  height: 64px;
  background: rgba(253,250,245,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar_logo { display: flex; align-items: center; gap: 10px; }
.topbar_logo .logo_icon {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1rem;
}
.topbar_logo .logo_name  { font-family: var(--font-h); font-size: 0.95rem; font-weight: 600; }
.topbar_logo .logo_sub   { font-size: 0.7rem; color: var(--text-lt); letter-spacing: .08em; text-transform: uppercase; }
.topbar_nav { display: flex; align-items: center; gap: 12px; }
.topbar_nav a, .topbar_nav button {
  padding: 7px 14px; border-radius: 8px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-lt); background: transparent; border: none;
  transition: var(--transition);
}
.topbar_nav a:hover, .topbar_nav button:hover {
  color: var(--primary); background: var(--primary-lt);
}
.topbar_user {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 600; color: var(--text);
}
.topbar_avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}

/* ══════════════════════════════════════════
   AUTH PAGE (login / registro)
══════════════════════════════════════════ */
.auth_page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--primary-lt) 100%);
  position: relative;
  overflow: hidden;
}
.auth_page::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196,168,130,0.12) 0%, transparent 70%);
}
.auth_card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.auth_logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth_logo .icon {
  width: 60px; height: 60px;
  background: var(--primary-lt);
  border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 12px;
}
.auth_logo h1 { font-family: var(--font-h); font-size: 1.4rem; margin-bottom: 4px; }
.auth_logo p  { font-size: 0.85rem; color: var(--text-lt); }

/* Tabs login / registro */
.auth_tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}
.auth_tab {
  flex: 1; text-align: center;
  padding: 10px;
  font-weight: 600; font-size: 0.9rem;
  color: var(--text-lt);
  cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.auth_tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Forms */
.auth_form { display: none; }
.auth_form.active { display: block; }

.form_group { margin-bottom: 18px; }
.form_group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form_group label span { color: var(--accent); }
.form_input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: var(--transition);
}
.form_input:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(139,115,85,0.1);
}
.form_input::placeholder { color: rgba(122,110,100,0.45); }
.form_row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Botones de auth */
.btn_auth {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 6px;
}
.btn_auth.primary { background: var(--primary); color: white; box-shadow: 0 4px 16px rgba(139,115,85,0.3); }
.btn_auth.primary:hover { background: var(--primary-dk); transform: translateY(-1px); }
.btn_auth.primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.form_footer {
  text-align: center;
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-lt);
}
.form_footer a { color: var(--primary); font-weight: 600; }
.form_footer a:hover { text-decoration: underline; }

/* Mensajes de error/éxito */
.auth_message {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
  display: none;
}
.auth_message.error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.auth_message.success { background: #e8f8ee; color: #2e7d52; border: 1px solid #a3d9b5; }
.auth_message.show    { display: flex; }

/* Demo notice */
.demo_notice {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: #e65100;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}

/* ══════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════ */
.dashboard_page {
  flex: 1;
  padding: 36px 24px 60px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

/* Bienvenida */
.welcome_banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
  border-radius: var(--radius-lg);
  color: white;
}
.welcome_text h2 { font-family: var(--font-h); font-size: 1.5rem; color: white; margin-bottom: 4px; }
.welcome_text p  { font-size: 0.88rem; opacity: 0.8; margin: 0; }
.welcome_badge {
  background: rgba(255,255,255,0.15);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}

/* Section card */
.dash_card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 24px;
}
.dash_card_header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.dash_card_icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--primary-lt);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--primary);
  flex-shrink: 0;
}
.dash_card_header h3 { font-size: 1.1rem; margin-bottom: 2px; }
.dash_card_header p  { font-size: 0.82rem; color: var(--text-lt); margin: 0; }

/* ── Selección de servicio ── */
.service_selector { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.service_option {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.service_option:hover { border-color: var(--secondary); background: var(--primary-lt); }
.service_option.selected { border-color: var(--primary); background: var(--primary-lt); }
.service_option.selected::after {
  content: '✓';
  position: absolute; top: 12px; right: 12px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
  line-height: 22px; text-align: center;
}
.service_option input[type="radio"] { display: none; }
.service_emoji { font-size: 1.8rem; margin-bottom: 8px; }
.service_name  { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; color: var(--text); }
.service_duration { font-size: 0.8rem; color: var(--text-lt); }

/* ── Botones de acción de pago/agenda ── */
.action_buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.btn_action {
  flex: 1; min-width: 180px;
  padding: 15px 24px;
  border: none; border-radius: 50px;
  font-size: 0.92rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: var(--transition);
  position: relative;
}
.btn_action .btn_icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}
.btn_pay {
  background: var(--primary); color: white;
  box-shadow: 0 4px 16px rgba(139,115,85,0.3);
}
.btn_pay:hover { background: var(--primary-dk); transform: translateY(-2px); }
.btn_pay.paid  { background: #e8f8ee; color: #2e7d52; cursor: default; transform: none; box-shadow: none; }

.btn_book {
  background: var(--accent); color: white;
  box-shadow: 0 4px 16px rgba(212,149,106,0.3);
}
.btn_book:hover:not(:disabled) { background: #c07a50; transform: translateY(-2px); }
.btn_book:disabled {
  background: #e8e0d8; color: #a09080;
  cursor: not-allowed; box-shadow: none; transform: none;
}
.btn_book .lock_icon { font-size: 0.9rem; }

/* Estado de pago */
.payment_status {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 20px;
}
.payment_status.pending  { background: #fff3e0; color: #E65100; border: 1px solid #ffcc80; }
.payment_status.paid     { background: #e8f8ee; color: #2e7d52; border: 1px solid #a3d9b5; }

/* ══════════════════════════════════════════
   MODAL DE HOTMART EMBED
══════════════════════════════════════════ */
.modal_overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal_overlay.open { display: flex; }
.modal_box {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 60px rgba(0,0,0,0.2);
  overflow: hidden;
}
.modal_header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal_header h3 { font-family: var(--font-h); font-size: 1.1rem; }
.modal_close {
  width: 32px; height: 32px;
  border-radius: 8px; background: var(--primary-lt);
  color: var(--primary); border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer; transition: var(--transition);
}
.modal_close:hover { background: var(--primary); color: white; }
.modal_body { flex: 1; overflow-y: auto; padding: 0; }
.modal_body iframe {
  width: 100%; height: 500px;
  border: none; display: block;
}
.modal_loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 300px; gap: 16px;
  color: var(--text-lt); font-size: 0.9rem;
}
.modal_loading i { font-size: 2rem; color: var(--secondary); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal_footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-lt);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   CALENDARIO DE CITAS
══════════════════════════════════════════ */
.booking_modal .modal_box { max-width: 680px; }
.booking_modal .modal_body { padding: 24px; }

/* Nav del mes */
.cal_header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal_month_label { font-family: var(--font-h); font-size: 1.1rem; }
.cal_nav_btn {
  width: 34px; height: 34px;
  border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--white); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); transition: var(--transition);
}
.cal_nav_btn:hover { background: var(--primary-lt); border-color: var(--primary); }

/* Grilla del mes */
.cal_grid { width: 100%; }
.cal_weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; margin-bottom: 8px;
}
.cal_weekday { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; color: var(--text-lt); padding: 6px 0; }
.cal_days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal_day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  cursor: default;
  transition: var(--transition);
  position: relative;
}
.cal_day.empty { }
.cal_day.past  { color: #c0b8b0; }
.cal_day.weekend { color: #c0b8b0; }
.cal_day.workday { font-weight: 500; }
.cal_day.available {
  cursor: pointer; font-weight: 600;
  color: var(--primary);
  border: 1.5px solid transparent;
}
.cal_day.available:hover { background: var(--primary-lt); border-color: var(--secondary); }
.cal_day.has_appt::after {
  content: '';
  position: absolute; bottom: 4px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.cal_day.selected {
  background: var(--primary); color: white !important;
  border-color: var(--primary);
}
.cal_day.selected::after { background: white; }
.cal_day.today { box-shadow: 0 0 0 2px var(--secondary); }

/* Slots de hora */
.slots_section { margin-top: 24px; }
.slots_label {
  font-size: 0.82rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-lt); margin-bottom: 12px;
}
.slots_grid {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.slot_btn {
  padding: 10px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 0.88rem; font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.slot_btn:hover    { border-color: var(--primary); color: var(--primary); background: var(--primary-lt); }
.slot_btn.selected { background: var(--primary); color: white; border-color: var(--primary); }
.slots_empty { font-size: 0.88rem; color: var(--text-lt); padding: 12px 0; }
.slots_loading { color: var(--text-lt); font-size: 0.88rem; display: flex; align-items: center; gap: 8px; }

/* Confirmación de cita */
.booking_summary {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--primary-lt);
  border-radius: var(--radius);
  border: 1px solid rgba(139,115,85,0.2);
  font-size: 0.9rem;
}
.booking_summary strong { display: block; margin-bottom: 8px; font-size: 0.95rem; }
.booking_summary .row { display: flex; gap: 8px; margin-bottom: 4px; }
.booking_summary .row i { color: var(--primary); width: 16px; }

/* Botón confirmar */
.btn_confirm_booking {
  width: 100%; padding: 14px;
  margin-top: 16px;
  border: none; border-radius: 50px;
  background: var(--accent); color: white;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(212,149,106,0.3);
}
.btn_confirm_booking:hover:not(:disabled) { background: #c07a50; transform: translateY(-1px); }
.btn_confirm_booking:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ══════════════════════════════════════════
   MIS CITAS
══════════════════════════════════════════ */
.appts_list { display: flex; flex-direction: column; gap: 14px; }
.appt_card {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 20px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.appt_card:hover { border-color: var(--secondary); box-shadow: var(--shadow); }
.appt_badge {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.appt_badge.psicologia  { background: #e8f0fc; }
.appt_badge.quirofisica { background: #fef0e8; }
.appt_info { flex: 1; }
.appt_label { font-weight: 700; font-size: 0.9rem; margin-bottom: 2px; }
.appt_datetime { font-size: 0.82rem; color: var(--text-lt); margin-bottom: 2px; }
.appt_datetime i { color: var(--primary); margin-right: 4px; }
.appt_status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
}
.appt_status.confirmed  { background: #e8f8ee; color: #2e7d52; }
.appt_status.cancelled  { background: #fce4ec; color: #c62828; }
.appts_empty {
  text-align: center; padding: 32px;
  color: var(--text-lt); font-size: 0.9rem;
}
.appts_empty i { font-size: 2.2rem; display: block; margin-bottom: 10px; color: var(--border); }

/* Toast notification */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--text); color: white;
  padding: 14px 24px; border-radius: 50px;
  font-size: 0.88rem; font-weight: 500;
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
  z-index: 9999; display: flex; align-items: center; gap: 10px;
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), opacity 0.3s;
  opacity: 0;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: #2e7d52; }
.toast.error   { background: #b91c1c; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 640px) {
  .auth_card { padding: 32px 20px; }
  .form_row  { grid-template-columns: 1fr; }
  .service_selector { grid-template-columns: 1fr; }
  .action_buttons { flex-direction: column; }
  .btn_action { min-width: 100%; }
  .dashboard_page { padding: 20px 14px 48px; }
  .dash_card { padding: 20px 16px; }
  .welcome_banner { padding: 20px; }
  .portal_topbar { padding: 0 16px; }
  .topbar_logo .logo_sub { display: none; }
  .cal_day { font-size: 0.78rem; }
  .modal_body iframe { height: 400px; }
}
