/* =========================================================
   NEXVOK — SHARED DESIGN SYSTEM
   Used by: index.html, appointment.html, privacy.html, terms.html,
   doctor-login.html, admin-login.html, appointment-history.html,
   patient-details.html
   Class names (.nx-header, .nx-logo, .nx-nav, .nx-btn*, .nx-card,
   .nx-container, .nx-footer) are shared with the staff pages: keep them.
========================================================= */

:root {
  --brand: #0e7490;
  --brand-dark: #155e75;
  --brand-darker: #0c4a5e;
  --brand-light: #e0f7fa;
  --brand-soft: #ecfeff;
  --brand-bright: #14b8c4;
  --navy: #1e3a8a;
  --navy-deep: #0b1b3f;
  --accent: #f59e0b;
  --accent-dark: #d97706;

  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --muted-soft: #94a3b8;

  --bg: #f5f9fb;
  --surface: #ffffff;
  --border: #e2e8f0;

  --success: #15803d;
  --success-bg: #ecfdf3;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning: #b45309;
  --warning-bg: #fffbeb;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);
  --shadow-brand: 0 14px 34px rgba(14, 116, 144, 0.28);

  --grad-brand: linear-gradient(135deg, var(--brand-bright) 0%, var(--brand) 45%, var(--navy) 100%);
  --grad-hero: radial-gradient(900px 520px at 90% -10%, rgba(20, 184, 196, 0.22), transparent 60%),
    radial-gradient(700px 480px at -10% 110%, rgba(30, 58, 138, 0.12), transparent 60%),
    linear-gradient(180deg, #f2fbfc 0%, #f5f9fb 100%);

  --font-head: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --header-h: 72px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  color: var(--ink);
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgba(245, 158, 11, 0.85);
  outline-offset: 2px;
}

/* =================== BUTTONS =================== */

.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  font-family: var(--font-body);
  white-space: nowrap;
}

.nx-btn-primary {
  background: var(--grad-brand);
  color: #ffffff;
  box-shadow: var(--shadow-brand);
}

.nx-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(14, 116, 144, 0.34);
  color: #ffffff;
}

.nx-btn-ghost {
  background: #ffffff;
  color: var(--brand-dark);
  border: 1.5px solid var(--border);
}

.nx-btn-ghost:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-2px);
}

.nx-btn-accent {
  background: var(--accent);
  color: #ffffff;
}

.nx-btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.nx-btn-white {
  background: #ffffff;
  color: var(--brand-darker);
  box-shadow: var(--shadow-md);
}

.nx-btn-white:hover {
  transform: translateY(-2px);
  color: var(--brand-darker);
}

.nx-btn-block {
  width: 100%;
}

/* =================== HEADER / NAV =================== */

.nx-header {
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  padding: 14px 4%;
  min-height: var(--header-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.nx-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-darker);
  text-decoration: none;
  flex-shrink: 0;
}

.nx-logo small {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 1px;
}

.nx-logo .nx-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--grad-brand);
  box-shadow: 0 6px 16px rgba(14, 116, 144, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.nx-logo-mark svg {
  width: 26px;
  height: 26px;
}

.nx-logo .nx-logo-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
}

.nx-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nx-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 16.5px;
  transition: color 0.15s ease;
}

.nx-nav a:hover,
.nx-nav a[aria-current="page"] {
  color: var(--brand);
}

.nx-nav .nx-nav-cta {
  background: var(--grad-brand);
  color: #ffffff !important;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-brand);
}

.nx-nav .nx-nav-cta:hover {
  color: #ffffff;
}

.nx-nav .nx-nav-muted {
  color: var(--muted);
  font-size: 15.5px;
}

/* menu button: only on pages whose header has .nx-has-menu (needs site.js) */
.nx-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink);
}

.nx-menu-btn span,
.nx-menu-btn span::before,
.nx-menu-btn span::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  position: relative;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nx-menu-btn span::before,
.nx-menu-btn span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nx-menu-btn span::before { top: -6px; }
.nx-menu-btn span::after { top: 6px; }

.nx-open .nx-menu-btn span { background: transparent; }
.nx-open .nx-menu-btn span::before { transform: translateY(6px) rotate(45deg); }
.nx-open .nx-menu-btn span::after { transform: translateY(-6px) rotate(-45deg); }

/* =================== SECTIONS =================== */

.nx-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 4%;
}

.nx-section {
  padding: 88px 4%;
}

.nx-section-inner {
  max-width: 1320px;
  margin: 0 auto;
}

.nx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid rgba(14, 116, 144, 0.14);
  font-weight: 700;
  font-size: 14.5px;
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.nx-section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.nx-section-head h2 {
  font-size: clamp(28px, 4.4vw, 40px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.nx-section-head p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
  margin: 0;
}

.nx-grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =================== CARDS =================== */

.nx-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* =================== PAGE BANNER (inner pages) =================== */

.nx-page-banner {
  background: var(--grad-hero);
  padding: 56px 4% 64px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.nx-page-banner h1 {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.nx-page-banner p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 620px;
}

/* =================== FOOTER =================== */

.nx-footer {
  background: radial-gradient(800px 300px at 100% 0%, rgba(20, 184, 196, 0.14), transparent 60%), var(--navy-deep);
  color: #cbd5e1;
  padding: 56px 4% 28px;
}

.nx-footer a {
  color: #cbd5e1;
  text-decoration: none;
}

.nx-footer a:hover {
  color: #ffffff;
}

.nx-footer .nx-logo {
  color: #ffffff;
}

.nx-footer-grid {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 36px;
}

.nx-footer-grid p {
  color: #94a3b8;
  line-height: 1.7;
  font-size: 15.5px;
  margin: 14px 0 0;
}

.nx-footer h5 {
  color: #ffffff;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 6px 0 14px;
}

.nx-footer-col a,
.nx-footer-col span {
  display: block;
  margin-bottom: 10px;
  font-size: 15.5px;
  line-height: 1.5;
}

.nx-footer-col span {
  color: #94a3b8;
}

.nx-footer-bottom {
  max-width: 1320px;
  margin: 36px auto 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
  text-align: center;
  font-size: 14.5px;
  color: #64748b;
}

/* =================== EMERGENCY STRIP =================== */

.nx-emergency {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--danger-bg);
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  color: #7f1d1d;
  line-height: 1.55;
}

.nx-emergency-icon {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--danger);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.nx-emergency strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.nx-emergency p {
  margin: 0 0 6px;
  font-size: 16px;
}

.nx-emergency p:last-child {
  margin-bottom: 0;
}

.nx-emergency a {
  color: var(--danger);
  font-weight: 800;
}

/* =================== MOBILE BOOK BAR =================== */

.nx-mobile-cta {
  display: none;
}

/* =================== SCROLL REVEAL (only with site.js) =================== */

.nx-js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.nx-js .reveal.in-view {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nx-js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* =================== RESPONSIVE =================== */

@media (max-width: 960px) {
  .nx-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  :root { --header-h: 64px; }

  .nx-header {
    padding: 10px 5%;
    flex-wrap: wrap;
  }

  /* headers without a menu button (staff pages): keep links usable */
  .nx-header:not(.nx-has-menu) .nx-nav {
    gap: 16px;
    overflow-x: auto;
    max-width: 100%;
  }

  .nx-header:not(.nx-has-menu) .nx-nav a {
    font-size: 14px;
    white-space: nowrap;
  }

  .nx-has-menu .nx-menu-btn {
    display: inline-flex;
  }

  .nx-has-menu .nx-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 0 6px;
  }

  .nx-has-menu.nx-open .nx-nav {
    display: flex;
  }

  .nx-has-menu .nx-nav a {
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 16px;
  }

  .nx-has-menu .nx-nav a:hover,
  .nx-has-menu .nx-nav a[aria-current="page"] {
    background: var(--brand-soft);
  }

  .nx-has-menu .nx-nav .nx-nav-cta {
    text-align: center;
    margin-top: 6px;
  }

  .nx-section {
    padding: 64px 5%;
  }

  .nx-section-head {
    margin-bottom: 34px;
  }
}

@media (max-width: 700px) {
  .nx-mobile-cta {
    display: flex;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  }

  .nx-mobile-cta .nx-btn {
    flex: 1;
    padding: 13px 14px;
  }

  .nx-mobile-cta .nx-btn-call {
    flex: 0 0 52px;
    padding: 0;
    font-size: 20px;
  }

  body.nx-has-mobile-cta {
    padding-bottom: 76px;
  }
}

@media (max-width: 560px) {
  .nx-footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .nx-logo {
    font-size: 18px;
  }

  .nx-logo .nx-logo-mark {
    width: 36px;
    height: 36px;
  }

  .nx-page-banner {
    padding: 40px 5% 44px;
  }
}
