/* =====================================================================
   Dothan Counselling Services & Consultancy — site stylesheet
   ===================================================================== */

:root {
  /* Brand palette: green (primary), blue (secondary), pink (accent) - all
     three are backend-editable from Admin -> Settings; these are just the
     shipped defaults. Existing variable names (--dothan-teal-*, --dothan-
     gold*) are kept as-is since most of the stylesheet already references
     them - only their underlying colour values changed. --dothan-blue is
     new, used for secondary actions (.btn-teal). */
  --dothan-teal-900: #123b2e;
  --dothan-teal-700: #1f7a52;
  --dothan-teal-500: #2fa06c;
  --dothan-teal-100: #e6f5ec;
  --dothan-gold: #d9418f;
  --dothan-gold-dark: #b32873;
  --dothan-blue: #2464a8;
  --dothan-blue-dark: #1a4a80;
  --dothan-ink: #1f2937;
  --dothan-muted: #5b6b6a;
  --dothan-bg: #fbfaf7;
  --dothan-radius: 14px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--dothan-ink);
  background: var(--dothan-bg);
  line-height: 1.55;
}

h1, h2, h3, h4, h5, h6, .brand-mark {
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--dothan-teal-900);
}

a { text-decoration: none; color: var(--dothan-teal-700); }
a:hover { color: var(--dothan-gold-dark); }

.text-muted-soft { color: var(--dothan-muted); }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--dothan-teal-900);
  color: #eaf3f2;
  font-size: 0.85rem;
  padding: 8px 0;
}
.topbar a { color: #eaf3f2; margin-right: 22px; }
.topbar a:last-child { margin-right: 0; }
.topbar a:hover { color: var(--dothan-gold); }
.topbar-actions a { margin-left: 18px; margin-right: 0; }
.topbar-social a { color: #eaf3f2; margin-right: 14px; font-size: 0.95rem; }
.topbar-social a:last-child { margin-right: 0; }
.topbar-social a:hover { color: var(--dothan-gold); }

/* ---------- Header / nav ---------- */
.site-header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(18, 59, 58, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar { padding: 14px 0; }
.navbar-brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-mark {
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 2px;
  color: var(--dothan-teal-700);
}
.brand-sub {
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--dothan-muted);
}
.nav-link { font-weight: 500; color: var(--dothan-ink) !important; padding: 8px 14px !important; }
.nav-link:hover, .nav-link:focus { color: var(--dothan-teal-700) !important; }
.dropdown-menu { border-radius: 10px; border: none; box-shadow: 0 10px 30px rgba(18,59,58,0.12); }
.dropdown-item:active { background: var(--dothan-teal-700); }

/* Login/Register (or My Account/Logout), repeated inside the mobile menu -
   see includes/header.php for why. Only ever visible below the lg
   breakpoint, so it never doubles up with the desktop topbar. */
.mobile-auth-links {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(18, 59, 58, 0.1);
}
.mobile-auth-links .nav-link { flex: 1 1 auto; text-align: center; background: var(--dothan-teal-100); border-radius: 8px; }

.btn-brand {
  background: var(--dothan-gold);
  border: none;
  color: #1f2937 !important;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 50px;
}
.btn-brand:hover { background: var(--dothan-gold-dark); color: #fff !important; }

.btn-brand-outline {
  border: 2px solid #fff;
  color: #fff !important;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 50px;
}
.btn-brand-outline:hover { background: #fff; color: var(--dothan-teal-900) !important; }

.btn-teal {
  background: var(--dothan-blue);
  border: none;
  color: #fff !important;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 50px;
}
.btn-teal:hover { background: var(--dothan-blue-dark); color: #fff !important; }

/* ---------- Hero ---------- */
/* A 3-stop gradient using all three brand colours (green -> blue -> pink),
   rather than green alone - blue previously only appeared on .btn-teal. */
.hero {
  background: linear-gradient(135deg, var(--dothan-teal-900) 0%, var(--dothan-blue) 55%, var(--dothan-gold-dark) 100%);
  color: #fff;
  padding: 60px 0 76px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.hero h1 { color: #fff; font-size: 2.6rem; font-weight: 700; }
.hero .lead { color: #d9e9e8; font-size: 1.15rem; max-width: 620px; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: #fff;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-cta .btn { margin: 4px 8px 4px 0; }

.page-hero {
  background: linear-gradient(135deg, var(--dothan-teal-900) 0%, var(--dothan-blue) 60%, var(--dothan-gold-dark) 100%);
  color: #fff;
  padding: 40px 0;
}
.page-hero h1 { color: #fff; }
.page-hero p { color: #d9e9e8; max-width: 700px; }

/* ---------- Sections ---------- */
section { padding: 46px 0; }
.section-tag {
  display: inline-block;
  color: var(--dothan-gold-dark);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 6px;
}
.section-title { font-size: 2rem; font-weight: 700; margin-bottom: 12px; }
.bg-soft { background: var(--dothan-teal-100); }
.bg-ink { background: var(--dothan-teal-900); color: #fff; }
.bg-ink h2, .bg-ink h3, .bg-ink h4 { color: #fff; }

/* ---------- Cards ---------- */
.card-dothan {
  background: #fff;
  border-radius: var(--dothan-radius);
  padding: 20px 20px;
  border: 1px solid rgba(18,59,58,0.07);
  box-shadow: 0 6px 24px rgba(18,59,58,0.05);
  transition: transform .2s ease, box-shadow .2s ease;
}
/* Equal-height grid cards use Bootstrap's .h-100 utility explicitly (added
   per-usage in the markup) rather than a blanket height:100% here. A blanket
   rule broke every page that stacks two or more .card-dothan blocks inside
   the same column/container (Contact, About, dashboards, account settings,
   assessment results) - each card's height:100% resolved against the
   shared parent and multiplied the parent's own height with each sibling,
   producing pages many screens taller than their actual content. */
.card-dothan:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(18,59,58,0.12); }
.card-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--dothan-teal-100);
  color: var(--dothan-teal-700);
  border-radius: 12px;
  font-size: 1.4rem;
  margin-bottom: 12px;
}

/* ---------- Featured service cards (Services page) ---------- */
.card-dothan.card-featured {
  border: 1px solid rgba(217,65,143,0.35);
  box-shadow: 0 10px 30px rgba(217,65,143,0.14);
  position: relative;
}
.featured-badge {
  position: absolute;
  top: -12px;
  right: 18px;
  background: var(--dothan-gold);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(217,65,143,0.3);
}

.audience-pill {
  display: inline-block;
  background: #fff;
  border: 1px solid rgba(18,59,58,0.12);
  border-radius: 50px;
  padding: 10px 20px;
  margin: 5px;
  font-weight: 500;
  color: var(--dothan-teal-900);
}

/* ---------- Stats ---------- */
.stat-block { text-align: center; }
.stat-number { font-family: 'Poppins', sans-serif; font-size: 2.4rem; font-weight: 700; color: var(--dothan-teal-700); }
.stat-label { color: var(--dothan-muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Forms ---------- */
.form-dothan {
  background: #fff;
  border-radius: var(--dothan-radius);
  padding: 24px;
  box-shadow: 0 10px 40px rgba(18,59,58,0.08);
}
.form-label { font-weight: 600; color: var(--dothan-teal-900); margin-bottom: 0.3rem; }
.form-control, .form-select {
  border-radius: 10px;
  border: 1px solid rgba(18,59,58,0.18);
  padding: 8px 14px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--dothan-teal-500);
  box-shadow: 0 0 0 0.2rem rgba(44,143,137,0.15);
}

/* Compact fields (M-Pesa code, phone, amount entry next to a button) - kept
   narrow on desktop so they sit neatly beside their button, but this is
   overridden back to full-width on phones in the mobile block below, since
   a fixed pixel max-width is what was making them too small to comfortably
   read/type into on a phone screen. Use this class instead of an inline
   max-width style on any new short input. */
.field-compact { max-width: 170px; }
.scale-options { display: flex; flex-wrap: wrap; gap: 8px; }
.scale-options label {
  border: 1px solid rgba(18,59,58,0.18);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.92rem;
}
.scale-options input { margin-right: 6px; }

/* ---------- Password show/hide toggle (injected by assets/js/main.js) ---------- */
.password-toggle-wrap { position: relative; }
.password-toggle-input { padding-right: 42px !important; }
.password-toggle-btn {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--dothan-muted);
  padding: 8px 10px;
  cursor: pointer;
  line-height: 1;
}
.password-toggle-btn:hover { color: var(--dothan-teal-700); }
.scale-options input:checked + span,
.scale-options label:has(input:checked) {
  border-color: var(--dothan-teal-700);
  background: var(--dothan-teal-100);
}

/* ---------- Assessment results ---------- */
.result-card {
  border-radius: var(--dothan-radius);
  padding: 18px 20px;
  background: #fff;
  border-left: 6px solid var(--dothan-teal-500);
  box-shadow: 0 6px 20px rgba(18,59,58,0.06);
  margin-bottom: 14px;
}
.result-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}
.progress { height: 10px; border-radius: 50px; }

.safety-alert {
  background: #fdecea;
  border: 2px solid #c0392b;
  border-radius: var(--dothan-radius);
  padding: 20px 22px;
  color: #7a2118;
}

/* ---------- Table ---------- */
.table-dothan thead { background: var(--dothan-teal-900); color: #fff; }
.table-dothan td, .table-dothan th { vertical-align: middle; padding: 0.5rem 0.6rem; }

/* ---------- Contact info panel (single card, not a stack) ---------- */
.contact-info-card {
  background: linear-gradient(160deg, var(--dothan-teal-900) 0%, var(--dothan-blue) 65%, var(--dothan-gold-dark) 100%);
  border-radius: var(--dothan-radius);
  padding: 24px 22px;
  color: #eaf3f2;
  box-shadow: 0 14px 40px rgba(18,59,58,0.18);
}
.contact-info-card h4 { color: #fff; }
.contact-info-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.contact-info-row:last-of-type { margin-bottom: 0; }
.contact-info-icon {
  flex: none;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.12);
  color: var(--dothan-gold);
  border-radius: 50%;
  font-size: 1.05rem;
}
.contact-info-row strong { display: block; color: #fff; margin-bottom: 2px; font-family: 'Poppins', sans-serif; font-size: 0.95rem; }
.contact-info-row p, .contact-info-row a { color: #d9e9e8; margin-bottom: 0; }
.contact-info-row a:hover { color: var(--dothan-gold); }
.contact-divider { border-color: rgba(255,255,255,0.18); margin: 18px 0; }
.contact-map-frame {
  border-radius: var(--dothan-radius);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(18,59,58,0.1);
  margin-top: 16px;
}

/* ---------- Compact fact grid (e.g. client bio-data summary) ----------
   A row of "Label: value" facts that vary a lot in length. A fixed-width
   Bootstrap column grid leaves ragged gaps after short values (e.g.
   "Gender: Female" sits in the same width as "Marital Status: Married"),
   so this wraps items to their own content width instead, with a
   consistent gap between them - short facts sit close together, long
   ones wrap to the next line naturally. */
.fact-grid { display: flex; flex-wrap: wrap; row-gap: 8px; column-gap: 32px; }
.confidential-note {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dothan-muted);
  font-size: 0.85rem;
  margin-top: 12px;
}
.confidential-note i { color: var(--dothan-teal-700); }

/* ---------- Crisis / safety bar (permanent, on every page - never dismissible) ---------- */
.crisis-bar {
  background: #7a2118;
  color: #fdecea;
  font-size: 0.85rem;
  text-align: center;
  padding: 10px 16px;
}
.crisis-bar a { color: #fff; text-decoration: underline; font-weight: 600; }
.crisis-bar a:hover { color: var(--dothan-gold); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dothan-teal-900);
  color: #cfe3e1;
  padding: 40px 0 10px;
  margin-top: 24px;
}
.site-footer h6 { color: #fff; text-transform: uppercase; letter-spacing: 1px; font-size: 0.85rem; margin-bottom: 12px; }
.site-footer a { color: #cfe3e1; }
.site-footer a:hover { color: var(--dothan-gold); }
.footer-links, .footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-links li, .footer-contact li { margin-bottom: 8px; }
.footer-contact i { width: 18px; color: var(--dothan-gold); margin-right: 6px; }
.footer-brand .brand-mark { color: #fff; }
.footer-brand .brand-sub { color: #a9c4c1; }
.social-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  margin-right: 8px;
}
.site-footer hr { border-color: rgba(255,255,255,0.15); }

/* ---------- WhatsApp float ---------- */
.whatsapp-float {
  position: fixed;
  bottom: 26px; right: 26px;
  width: 58px; height: 58px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 8px 22px rgba(0,0,0,0.25);
  z-index: 1050;
}
.whatsapp-float:hover { color: #fff; transform: scale(1.06); }

/* ---------- Admin / dashboard shell ---------- */
.dash-shell { display: flex; min-height: 100vh; }
.dash-sidebar {
  width: 250px;
  background: var(--dothan-teal-900);
  color: #eaf3f2;
  flex-shrink: 0;
  padding: 14px 0;
}
.dash-sidebar a {
  display: block;
  color: #d9e9e8;
  padding: 9px 24px;
  font-size: 0.93rem;
}
.dash-sidebar a:hover, .dash-sidebar a.active { background: rgba(255,255,255,0.08); color: #fff; }
.dash-sidebar .brand-mark { color: #fff; padding: 0 24px; display:block; }
.dash-main { flex: 1; padding: 20px 24px; max-width: 100%; overflow-x: auto; }
.dash-topbar { display:flex; justify-content: space-between; align-items:center; margin-bottom: 16px; }

@media (max-width: 768px) {
  .dash-shell { flex-direction: column; }
  .dash-sidebar { width: 100%; }

  /* Form inputs on phones: iOS Safari auto-zooms the whole page on focus
     for any text input under 16px, which is what made fields like the
     M-Pesa code and amount boxes feel like typing "wasn't working" - the
     page would jump/zoom the moment you tapped in. Forcing 16px stops
     that. .form-control-sm also drops to a fairly short, thumb-unfriendly
     tap target at Bootstrap's default size, so it's bumped back up here too. */
  .form-control, .form-select {
    font-size: 16px;
  }
  .form-control-sm, .form-select-sm {
    font-size: 16px;
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: 44px;
  }
  /* Any field kept deliberately narrow on desktop (M-Pesa code, phone,
     amount) goes full-width on phones instead of staying pinned to a
     small pixel width - see .field-compact above. */
  .field-compact {
    max-width: 100%;
    width: 100%;
  }
  /* Amount fields wrapped in an input-group (e.g. the "KES [amount]" box
     on Admin -> Appointments) get the same treatment. */
  .input-group.field-compact {
    display: flex;
  }
}

/* ---------- Print (assessment results) ---------- */
@media print {
  .site-header, .site-footer, .whatsapp-float, .topbar, .no-print { display: none !important; }
  body { background: #fff; }
}
