/* ============================================================
   Renu Medicare Pharma — healthcare theme
   Palette: teal primary, deep navy text, soft mint surfaces
   ============================================================ */

:root {
  --rpc-primary: #0e7c7b;
  --rpc-primary-dark: #0a5e5d;
  --rpc-primary-light: #e0f2f1;
  --rpc-accent: #f4a259;
  --rpc-navy: #1d3344;
  --rpc-text: #23323f;
  --rpc-muted: #6b7c8c;
  --rpc-bg: #f4f7f9;
  --rpc-card: #ffffff;
  --rpc-border: #e3e8ee;
  --rpc-danger: #c0392b;
  --rpc-success: #1e8e5a;
  --rpc-warning: #b9770e;
}

body {
  background: var(--rpc-bg);
  color: var(--rpc-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--rpc-primary); }

/* ---------- Brand ---------- */
.rpc-logo {
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--rpc-primary);
  font-size: 1.35rem;
  text-decoration: none;
}
.rpc-logo .plus { color: var(--rpc-accent); }
.rpc-logo:hover { color: var(--rpc-primary-dark); }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(150deg, var(--rpc-primary-light) 0%, var(--rpc-bg) 55%);
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--rpc-card);
  border: 1px solid var(--rpc-border);
  border-radius: 14px;
  box-shadow: 0 10px 35px rgba(13, 60, 60, .10);
  padding: 36px;
}
.auth-card.wide { max-width: 640px; }
.auth-tagline { color: var(--rpc-muted); font-size: .95rem; }

/* ---------- Buttons ---------- */
.btn-rpc {
  background: var(--rpc-primary);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: .6rem 1.4rem;
  border-radius: 8px;
}
.btn-rpc:hover, .btn-rpc:focus { background: var(--rpc-primary-dark); color: #fff; }
.btn-rpc-outline {
  background: transparent;
  border: 1.5px solid var(--rpc-primary);
  color: var(--rpc-primary);
  font-weight: 600;
  border-radius: 8px;
}
.btn-rpc-outline:hover { background: var(--rpc-primary-light); color: var(--rpc-primary-dark); }

/* ---------- Portal layout ---------- */
.portal {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--rpc-navy);
  color: #cfe0e8;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  padding: 20px 22px;
  font-weight: 800;
  color: #fff;
  font-size: 1.15rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand .plus { color: var(--rpc-accent); }
.sidebar .role-chip {
  margin: 14px 22px 4px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8fb0c0;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #cfe0e8;
  padding: 11px 22px;
  text-decoration: none;
  font-size: .95rem;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active {
  background: rgba(14,124,123,.25);
  border-left-color: var(--rpc-accent);
  color: #fff;
  font-weight: 600;
}
.sidebar .soon {
  font-size: .62rem;
  background: rgba(255,255,255,.12);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: auto;
  letter-spacing: .5px;
}
.sidebar .logout-link { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); }

/* Cascading menu groups (patient portal) */
.sidebar nav details.nav-group > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #cfe0e8;
  padding: 11px 22px;
  font-size: .95rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-left: 3px solid transparent;
}
.sidebar nav details.nav-group > summary::-webkit-details-marker { display: none; }
.sidebar nav details.nav-group > summary:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav details.nav-group[open] > summary { color: #fff; }
.sidebar nav details.nav-group .nav-group-label { flex: 1; }
.sidebar nav details.nav-group .nav-caret { font-size: .75rem; transition: transform .15s ease; opacity: .7; }
.sidebar nav details.nav-group[open] > summary .nav-caret { transform: rotate(180deg); }
.sidebar nav a.nav-child {
  padding-left: 44px;
  font-size: .9rem;
}
.sidebar nav a.nav-child i { font-size: .9rem; opacity: .85; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--rpc-card);
  border-bottom: 1px solid var(--rpc-border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar .who { font-weight: 600; }
.topbar .who small { color: var(--rpc-muted); font-weight: 400; }
.content { padding: 28px; }

/* ---------- Topbar feature search ---------- */
.psearch { position: relative; flex: 1 1 200px; max-width: 340px; min-width: 160px; }
.psearch > .bi-search {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--rpc-muted); font-size: .9rem; pointer-events: none;
}
.psearch input {
  width: 100%; min-height: 40px;
  border: 1px solid var(--rpc-border); border-radius: 10px;
  padding: 7px 12px 7px 34px; font-size: .92rem;
  background: var(--rpc-bg); color: var(--rpc-text);
}
.psearch input:focus {
  outline: none; border-color: var(--rpc-primary);
  box-shadow: 0 0 0 3px rgba(14, 124, 123, .15); background: #fff;
}
.psearch-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1060;
  background: #fff; border: 1px solid var(--rpc-border); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(29, 51, 68, .18);
  max-height: min(420px, 60vh); overflow-y: auto; padding: 6px;
}
.psearch-results a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--rpc-text); text-decoration: none; font-size: .92rem;
}
.psearch-results a .bi { color: var(--rpc-primary); flex: 0 0 auto; }
.psearch-results a .ps-group {
  margin-left: auto; font-size: .78rem; color: var(--rpc-muted); white-space: nowrap;
}
.psearch-results a.active, .psearch-results a:hover { background: var(--rpc-primary-light); }
.psearch-empty { padding: 10px 12px; color: var(--rpc-muted); font-size: .88rem; }
@media (max-width: 640px) {
  .psearch { order: 9; flex-basis: 100%; max-width: none; }
}

/* ---------- Cards & stats ---------- */
.stat-card {
  background: var(--rpc-card);
  border: 1px solid var(--rpc-border);
  border-radius: 12px;
  padding: 20px 22px;
  height: 100%;
}
.stat-card .label { color: var(--rpc-muted); font-size: .85rem; }
.stat-card .value { font-size: 1.9rem; font-weight: 800; color: var(--rpc-navy); }
.stat-card .icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--rpc-primary-light);
  color: var(--rpc-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.panel {
  background: var(--rpc-card);
  border: 1px solid var(--rpc-border);
  border-radius: 12px;
  padding: 22px;
}
.panel h6 { font-weight: 700; color: var(--rpc-navy); margin-bottom: 14px; }

.table thead th { color: var(--rpc-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }

/* ---------- Badges ---------- */
.badge-status { font-size: .75rem; padding: .35em .7em; border-radius: 6px; font-weight: 600; }
.bs-active, .bs-delivered, .bs-paid, .bs-verified, .bs-normal { background: #e3f6ec; color: var(--rpc-success); }
.bs-pending, .bs-placed, .bs-booked { background: #fdf3e3; color: var(--rpc-warning); }
.bs-locked, .bs-failed, .bs-critical, .bs-cancelled { background: #fdeceb; color: var(--rpc-danger); }
.bs-info, .bs-shipped, .bs-confirmed { background: var(--rpc-primary-light); color: var(--rpc-primary-dark); }

/* ---------- Register wizard ---------- */
.wizard-steps { display: flex; gap: 8px; margin-bottom: 22px; }
.wizard-steps .step {
  flex: 1; text-align: center; font-size: .8rem; color: var(--rpc-muted);
  padding-bottom: 8px; border-bottom: 3px solid var(--rpc-border);
}
.wizard-steps .step.active { color: var(--rpc-primary); border-color: var(--rpc-primary); font-weight: 700; }
.wizard-pane { display: none; }
.wizard-pane.active { display: block; }

/* Charts need a fixed-height box or Chart.js grows without limit */
.chart-box { position: relative; height: 230px; }

/* Honeypot field — invisible to humans */
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* Mobile: sidebar becomes a slide-in drawer behind a hamburger button (UAT-15) */
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .portal { flex-direction: column; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 270px;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.35); }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--rpc-navy);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1.05rem;
  }
  .nav-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1040;
  }
  .nav-backdrop.show { display: block; }
  .content { padding: 18px; }
}

/* ---------- Marketing landing page ---------- */
.landing-body { background: #fff; }
.landing-nav {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--rpc-border);
}
.landing-nav a { text-decoration: none; color: var(--rpc-navy); }
.landing-nav a:hover { color: var(--rpc-primary); }
.landing-hero {
  background: linear-gradient(135deg, var(--rpc-navy) 0%, var(--rpc-primary-dark) 70%, var(--rpc-primary) 100%);
  color: #fff;
}
.hero-photo-stack { position: relative; height: 360px; }
.hero-photo {
  position: absolute; width: 200px; height: 240px; object-fit: cover; object-position: top;
  border-radius: 16px; border: 4px solid rgba(255,255,255,.9);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.hero-photo-0 { left: 0; top: 20px; transform: rotate(-4deg); z-index: 3; }
.hero-photo-1 { left: 150px; top: 70px; transform: rotate(3deg); z-index: 2; }
.hero-photo-2 { left: 290px; top: 10px; transform: rotate(-2deg); z-index: 1; }
.landing-feature i { font-size: 2rem; color: var(--rpc-primary); }
.doctor-card .doctor-photo {
  width: 86px; height: 104px; object-fit: cover; object-position: top;
  border-radius: 12px; flex-shrink: 0; background: var(--rpc-primary-light);
}
.doctor-initials {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; color: var(--rpc-primary);
}
.landing-checklist li { padding: .45rem 0; display: flex; gap: .7rem; }
.landing-checklist i { color: var(--rpc-primary); font-size: 1.15rem; flex-shrink: 0; }
.landing-step {
  width: 52px; height: 52px; margin: 0 auto; border-radius: 50%;
  background: var(--rpc-primary); color: #fff; font-size: 1.4rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.landing-footer { background: var(--rpc-navy); color: #fff; }
.landing-footer a { color: rgba(255,255,255,.85); text-decoration: none; }
.landing-footer a:hover { color: #fff; text-decoration: underline; }

/* ---------- Floating WhatsApp CTA ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; align-items: center; gap: 10px;
  background: #25d366; color: #fff; text-decoration: none;
  padding: 12px 16px; border-radius: 40px;
  box-shadow: 0 6px 20px rgba(0,0,0,.28); font-weight: 600;
}
.wa-float:hover { background: #1ebe5a; color: #fff; }
.wa-float i { font-size: 1.5rem; }
.wa-float-label { font-size: .85rem; line-height: 1.15; }
.wa-float-sub { font-weight: 400; font-size: .72rem; opacity: .9; }
@media (max-width: 575px) {
  .wa-float-label { display: none; }
  .wa-float { padding: 14px; }
}
