/* ═══════════════════════════════════════════════════════════
   UK HealthLink – Main Stylesheet
   Palette: NHS Blue #1a56db, White, Light Gray
   ═══════════════════════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:        #1a56db;
  --blue-dark:   #1240ab;
  --blue-light:  #e8f0fe;
  --teal:        #0d9488;
  --teal-light:  #ccfbf1;
  --white:       #ffffff;
  --gray-50:     #f8fafc;
  --gray-100:    #f1f5f9;
  --gray-200:    #e2e8f0;
  --gray-300:    #cbd5e1;
  --gray-500:    #64748b;
  --gray-700:    #334155;
  --gray-900:    #0f172a;
  --danger:      #dc2626;
  --danger-light:#fee2e2;
  --success:     #16a34a;
  --success-light:#dcfce7;
  --warning:     #d97706;
  --warning-light:#fef3c7;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --transition:  .2s ease;
  --sidebar-w:   260px;
  --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--gray-700); background: var(--gray-50); line-height: 1.6; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ─── Container ─────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.2rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 2px solid transparent; transition: var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-primary  { background: var(--blue);  color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); text-decoration: none; }
.btn-outline  { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue-light); text-decoration: none; }
.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { opacity: .9; text-decoration: none; }
.btn-success  { background: var(--success); color: #fff; border-color: var(--success); }
.btn-teal     { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-sm  { padding: .35rem .85rem; font-size: .82rem; }
.btn-lg  { padding: .75rem 1.8rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ─── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; margin-bottom: .35rem; font-weight: 600; font-size: .9rem; color: var(--gray-700); }
.form-control {
  width: 100%; padding: .6rem .85rem;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius);
  font-size: .95rem; font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,219,.15); }
.form-hint { font-size: .8rem; color: var(--gray-500); margin-top: .25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width:600px){ .form-row { grid-template-columns: 1fr; } }

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.card-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h2, .card-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); }
.card-body { padding: 1.4rem; }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: .85rem 1.1rem; border-radius: var(--radius);
  margin-bottom: 1rem; font-size: .92rem; display: flex; align-items: center; gap: .6rem;
}
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #bbf7d0; }
.alert-error   { background: var(--danger-light);  color: var(--danger);  border: 1px solid #fecaca; }
.alert-info    { background: var(--blue-light);     color: var(--blue);    border: 1px solid #bfdbfe; }
.alert-warning { background: var(--warning-light);  color: var(--warning); border: 1px solid #fde68a; }

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .22rem .65rem;
  border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .03em;
}
.badge-success   { background: var(--success-light); color: var(--success); }
.badge-warning   { background: var(--warning-light); color: var(--warning); }
.badge-danger    { background: var(--danger-light);  color: var(--danger);  }
.badge-info      { background: var(--blue-light);    color: var(--blue);    }
.badge-secondary { background: var(--gray-100);      color: var(--gray-500);}

/* ─── Table ─────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th { background: var(--gray-50); color: var(--gray-700); font-weight: 700;
           padding: .75rem 1rem; text-align: left; border-bottom: 2px solid var(--gray-200); }
tbody td { padding: .75rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

/* ─── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--white); border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 1rem;
}
.navbar-brand {
  display: flex; align-items: center; gap: .55rem;
  font-size: 1.15rem; color: var(--gray-900); font-weight: 700;
  text-decoration: none;
}
.navbar-brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: .5rem; }
.nav-links li a {
  padding: .4rem .75rem; border-radius: var(--radius);
  color: var(--gray-700); font-weight: 500; font-size: .92rem;
  transition: var(--transition);
}
.nav-links li a:hover { background: var(--blue-light); color: var(--blue); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 50%, #0e3da3 100%);
  color: #fff; padding: 5rem 0 4rem;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -100px; top: -100px;
  width: 500px; height: 500px; border-radius: 50%;
  background: rgba(255,255,255,.04);
}
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero-title { font-size: 2.6rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.1rem; opacity: .88; margin-bottom: 1.8rem; line-height: 1.7; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-cta .btn-white { background: #fff; color: var(--blue); border-color: #fff; }
.hero-cta .btn-white:hover { background: var(--blue-light); text-decoration: none; }
.hero-cta .btn-ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.6); }
.hero-cta .btn-ghost:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.hero-img-wrapper { position: relative; }
.hero-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.hero-stat {
  background: rgba(255,255,255,.12); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-lg); padding: 1.25rem; text-align: center;
}
.hero-stat strong { display: block; font-size: 1.8rem; font-weight: 800; }
.hero-stat span { font-size: .85rem; opacity: .85; }

/* ─── Features grid ──────────────────────────────────────────── */
.section { padding: 4rem 0; }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2 { font-size: 2rem; font-weight: 800; color: var(--gray-900); margin-bottom: .5rem; }
.section-title p { color: var(--gray-500); font-size: 1.05rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.feature-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 1.75rem; box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
  border-top: 4px solid var(--blue);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 2.2rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); margin-bottom: .5rem; }
.feature-card p { color: var(--gray-500); font-size: .92rem; line-height: 1.6; }

/* ─── Tests grid ─────────────────────────────────────────────── */
.tests-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.test-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow);
  border: 1.5px solid var(--gray-200); transition: border-color var(--transition), box-shadow var(--transition);
}
.test-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
.test-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; color: var(--gray-900); }
.test-card p { font-size: .85rem; color: var(--gray-500); margin-bottom: 1rem; }
.test-price { font-size: 1.3rem; font-weight: 800; color: var(--blue); margin-bottom: .75rem; }

/* ─── Auth pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue-light) 0%, var(--white) 100%);
  padding: 2rem 1rem;
}
.auth-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 2.5rem; width: 100%; max-width: 440px; }
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo svg { margin: 0 auto .5rem; }
.auth-logo h2 { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); }
.auth-logo p { color: var(--gray-500); font-size: .9rem; }
.auth-footer { text-align: center; margin-top: 1.2rem; font-size: .88rem; color: var(--gray-500); }

/* ─── Dashboard layout ───────────────────────────────────────── */
.dashboard-body { background: var(--gray-100); min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; height: 100vh; width: var(--sidebar-w);
  background: var(--gray-900); color: #fff; display: flex; flex-direction: column;
  z-index: 200; transition: transform var(--transition);
}
.sidebar-brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 1.25rem 1.2rem; font-size: 1.05rem; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-nav li { margin: .15rem .75rem; }
.sidebar-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .85rem; border-radius: var(--radius);
  color: rgba(255,255,255,.75); font-size: .92rem; font-weight: 500;
  transition: var(--transition);
}
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.sidebar-link.active { background: var(--blue); color: #fff; }
.sidebar-icon { font-size: 1.1rem; }
.sidebar-footer { padding: 1rem 1.2rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: .7rem; margin-bottom: .75rem; }
.sidebar-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--blue); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 1rem;
}
.sidebar-name { font-weight: 600; font-size: .9rem; }
.sidebar-role { font-size: .78rem; color: rgba(255,255,255,.55); text-transform: capitalize; }
.sidebar-logout {
  display: block; padding: .5rem .85rem; border-radius: var(--radius);
  background: rgba(220,38,38,.2); color: #fca5a5; font-size: .88rem;
  text-align: center; transition: var(--transition);
}
.sidebar-logout:hover { background: rgba(220,38,38,.35); color: #fca5a5; text-decoration: none; }

.dashboard-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.dashboard-header {
  background: var(--white); border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.75rem; display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow);
}
.dashboard-title { font-size: 1.2rem; font-weight: 700; color: var(--gray-900); }
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--gray-700); }
.dashboard-content { padding: 1.75rem; flex: 1; }

/* ─── Stats cards ────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 1.75rem; }
.stat-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 1.4rem; box-shadow: var(--shadow-md);
  border-left: 4px solid var(--blue); display: flex; flex-direction: column; gap: .4rem;
}
.stat-card.teal   { border-color: var(--teal); }
.stat-card.green  { border-color: var(--success); }
.stat-card.orange { border-color: var(--warning); }
.stat-card.red    { border-color: var(--danger); }
.stat-label { font-size: .82rem; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--gray-900); }
.stat-sub   { font-size: .82rem; color: var(--gray-500); }

/* ─── Page grid helpers ──────────────────────────────────────── */
.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
@media(max-width:900px) { .content-grid { grid-template-columns: 1fr; } }

/* ─── Stepper ────────────────────────────────────────────────── */
.stepper { display: flex; gap: 0; margin-bottom: 2rem; }
.step {
  flex: 1; text-align: center; position: relative;
  padding: .75rem .5rem;
}
.step::after {
  content: ''; position: absolute; top: 50%; right: 0;
  width: 100%; height: 2px; background: var(--gray-200); z-index: 0;
}
.step:last-child::after { display: none; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gray-200); color: var(--gray-500); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; z-index: 1; font-size: .85rem; margin-bottom: .35rem;
}
.step.active   .step-num { background: var(--blue);    color: #fff; }
.step.complete .step-num { background: var(--success); color: #fff; }
.step-label { font-size: .78rem; font-weight: 600; color: var(--gray-500); }
.step.active   .step-label { color: var(--blue); }
.step.complete .step-label { color: var(--success); }

/* ─── Jobs board ─────────────────────────────────────────────── */
.jobs-grid { display: flex; flex-direction: column; gap: 1rem; }
.job-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 1.4rem; box-shadow: var(--shadow);
  border: 1.5px solid var(--gray-200); transition: border-color var(--transition);
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start;
}
.job-card:hover { border-color: var(--blue); }
.job-title  { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); margin-bottom: .3rem; }
.job-meta   { display: flex; gap: .75rem; flex-wrap: wrap; font-size: .85rem; color: var(--gray-500); }
.job-meta span { display: flex; align-items: center; gap: .25rem; }
.job-salary { font-size: 1.05rem; font-weight: 700; color: var(--blue); margin-bottom: .5rem; }
.job-featured { border-color: var(--teal); border-width: 2px; }
.featured-label { background: var(--teal); color: #fff; font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; }

/* ─── Upsell banner ──────────────────────────────────────────── */
.upsell-banner {
  background: linear-gradient(135deg, var(--teal) 0%, #0f766e 100%);
  color: #fff; border-radius: var(--radius-lg); padding: 1.5rem 2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-top: 1.5rem;
}
.upsell-text h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .25rem; }
.upsell-text p { font-size: .9rem; opacity: .9; }

/* ─── Divider ────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--gray-200); margin: 1.5rem 0; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .dashboard-main { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-cta { justify-content: center; }
  .hero-stats { justify-items: center; }
}
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .nav-links {
    display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--gray-200); padding: 1rem;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .dashboard-content { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .job-card { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0 2.5rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
}

/* ─── Overlay for mobile sidebar ────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 190;
}
.sidebar-overlay.active { display: block; }

/* ─── Payment page ───────────────────────────────────────────── */
.payment-box {
  max-width: 520px; margin: 3rem auto;
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 2.5rem;
  text-align: center;
}
.payment-box h2 { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); margin-bottom: .5rem; }
.payment-box .price-tag { font-size: 3rem; font-weight: 800; color: var(--blue); margin: 1rem 0; }
.payment-box p { color: var(--gray-500); margin-bottom: 1.5rem; }

/* ─── Search/filter bar ──────────────────────────────────────── */
.filter-bar { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filter-bar .form-control { max-width: 220px; }

/* ─── Empty state ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--gray-500); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--gray-700); margin-bottom: .4rem; }

/* ─── Consultation reply box ─────────────────────────────────── */
.reply-box { background: var(--blue-light); border: 1.5px solid #bfdbfe; border-radius: var(--radius-lg); padding: 1.4rem; margin-top: 1rem; }
.reply-box h4 { font-size: .95rem; font-weight: 700; color: var(--blue-dark); margin-bottom: .75rem; }

/* ─── Admin Revenue chart placeholder ───────────────────────── */
.chart-placeholder { background: var(--gray-50); border: 2px dashed var(--gray-200); border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--gray-500); }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 500; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--gray-500); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); display: flex; gap: .75rem; justify-content: flex-end; }

/* ─── Misc helpers ───────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--gray-500); font-size: .87rem; }
.text-sm     { font-size: .87rem; }
.fw-bold     { font-weight: 700; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: .75rem; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius); }
.bg-light { background: var(--gray-50); }
.p-3 { padding: 1rem; }
.section-heading { font-size: 1.2rem; font-weight: 700; color: var(--gray-900); margin-bottom: 1rem; }
