/* ============================================================
   LDC Online Patient Portal — Professional Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  /* Reds */
  --red-900: #6B1010;
  --red-800: #7B1A1A;
  --red-700: #922B21;
  --red-600: #A93226;
  --red-500: #C0392B;
  --red-400: #D44C3B;
  --red-300: #E74C3C;
  --red-100: #FDEDEC;
  --red-50:  #FEF9F8;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #7B1A1A 0%, #C0392B 55%, #E74C3C 100%);
  --gradient-header:  linear-gradient(135deg, #5A0E0E 0%, #7B1A1A 35%, #A93226 75%, #C0392B 100%);
  --gradient-hero:    linear-gradient(160deg, #4A0A0A 0%, #7B1A1A 40%, #A93226 80%, #C0392B 100%);
  --gradient-print:   linear-gradient(135deg, #1A5276 0%, #2980B9 100%);

  /* Grays */
  --gray-50:  #F8F9FC;
  --gray-100: #F0F2F5;
  --gray-200: #E2E5EB;
  --gray-300: #C8CDD8;
  --gray-400: #9AA0B4;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --white:    #FFFFFF;
  --bg:       #EEF1F6;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 48px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.08);
  --shadow-red: 0 4px 16px rgba(192,57,43,0.38);

  /* Radii */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  --transition: all 0.25s ease;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--red-500); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--red-700); }
img { max-width: 100%; height: auto; }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5 { line-height: 1.3; font-weight: 600; color: var(--gray-900); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

/* ── Layout ───────────────────────────────────────────────── */
.container    { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.container-sm { max-width: 520px;  margin: 0 auto; padding: 0 1.25rem; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: var(--gradient-header);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
}

.header-logo {
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: white;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
}

.header-text .clinic-name {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.header-text .clinic-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 400;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.header-badge {
  background: rgba(255,255,255,0.12);
  color: white;
  padding: 0.3rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.22);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.6rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-red);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(192,57,43,0.48);
  color: white;
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.28);
}
.btn-ghost:hover { background: rgba(255,255,255,0.22); color: white; }

.btn-outline {
  background: transparent;
  color: var(--red-500);
  border: 1.5px solid #E07070;
}
.btn-outline:hover { background: var(--red-50); border-color: var(--red-500); color: var(--red-700); }

.btn-print {
  background: var(--gradient-print);
  color: white;
  box-shadow: 0 4px 14px rgba(41,128,185,0.35);
}
.btn-print:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(41,128,185,0.45); color: white; }

.btn-sm  { padding: 0.45rem 0.95rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.9rem 2rem; font-size: 0.97rem; }
.btn-full { width: 100%; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.card-header {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header-icon {
  width: 36px;
  height: 36px;
  background: var(--red-100);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-500);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.card-header h3 { font-size: 0.97rem; font-weight: 600; color: var(--gray-800); margin: 0; }
.card-header p  { font-size: 0.78rem; color: var(--gray-500); margin: 0; }
.card-body { padding: 1.5rem; }

/* ── Login Page ───────────────────────────────────────────── */
.login-page { flex: 1; display: flex; flex-direction: column; }

.login-hero {
  background: var(--gradient-hero);
  padding: 3.25rem 1.25rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.login-hero h1 {
  color: white;
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.25);
  position: relative;
}

.login-hero p {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}

.login-content {
  flex: 1;
  padding: 0 1.25rem 3rem;
  margin-top: -2.5rem;
  position: relative;
  z-index: 1;
}

.login-card         { max-width: 480px; margin: 0 auto 1.25rem; }
.instructions-card  { max-width: 480px; margin: 0 auto 1.25rem; }
.advisory-card      { max-width: 480px; margin: 0 auto 1.25rem; border-left: 4px solid var(--red-500); }

/* ── Form ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }

.form-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.45rem;
  letter-spacing: 0.01em;
}
.form-label span { font-weight: 400; color: var(--gray-500); }

.input-wrapper { position: relative; }

.input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.88rem;
  pointer-events: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}
.input-icon svg { fill: currentColor; }

.form-input {
  width: 100%;
  padding: 0.72rem 0.875rem 0.72rem 2.5rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--gray-800);
  background: var(--white);
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--red-400);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon { color: var(--red-400); }

.form-input::placeholder { color: var(--gray-300); font-weight: 300; }

.form-hint {
  font-size: 0.77rem;
  color: var(--gray-500);
  margin-top: 0.4rem;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.alert i { margin-top: 1px; flex-shrink: 0; }

.alert-error   { background: #FEF0EF; border: 1px solid #FADBD8; color: #922B21; }
.alert-warning { background: #FEFBF0; border: 1px solid #F9E79F; color: #7D6608; }
.alert-info    { background: #EBF5FB; border: 1px solid #AED6F1; color: #1A5276; }
.alert-success { background: #EAFAF1; border: 1px solid #A9DFBF; color: #1E8449; }

/* ── Instructions ─────────────────────────────────────────── */
.instruction-item {
  display: flex;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.instruction-item:last-child  { border-bottom: none; padding-bottom: 0; }
.instruction-item:first-child { padding-top: 0; }

.instruction-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--red-600);
  min-width: 90px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.instruction-desc { font-size: 0.84rem; color: var(--gray-600); }

.instruction-desc code {
  background: var(--gray-100);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-xs);
  font-size: 0.81rem;
  color: var(--gray-700);
  font-family: 'Courier New', monospace;
}

.instruction-example {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  background: var(--red-50);
  border: 1px solid #F5B7B1;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.875rem;
  color: var(--red-700);
  line-height: 1.8;
}

/* ── Advisory ─────────────────────────────────────────────── */
.advisory-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--red-700);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.55rem;
}

.advisory-text { font-size: 0.84rem; color: var(--gray-600); line-height: 1.75; }
.advisory-date { font-size: 0.75rem; color: var(--gray-400); font-style: italic; margin-top: 0.4rem; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--gray-900);
  color: rgba(255,255,255,0.55);
  text-align: center;
  padding: 1.25rem 1.25rem;
  font-size: 0.78rem;
  margin-top: auto;
}
.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: white; }
.footer-divider { margin: 0 0.5rem; opacity: 0.3; }

/* ── Dashboard ────────────────────────────────────────────── */
.dashboard-page { flex: 1; }
.page-content   { padding: 1.75rem 0 3rem; }

/* Patient Info Card */
.patient-info-card {
  background: linear-gradient(135deg, #fff6f6 0%, var(--white) 65%);
  border: 1px solid #F5C6C2;
  border-radius: var(--radius-lg);
  padding: 1.375rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.patient-avatar {
  width: 54px;
  height: 54px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: var(--shadow-red);
}

.patient-details h2 { font-size: 1.1rem; color: var(--gray-900); margin-bottom: 0.3rem; }

.patient-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.patient-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--gray-500);
  background: var(--gray-50);
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
}
.patient-meta-item i { color: var(--red-400); font-size: 0.72rem; }

.patient-info-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Section Title */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.section-title h2    { font-size: 1rem; color: var(--gray-800); white-space: nowrap; }
.section-title-line  { flex: 1; height: 1px; background: var(--gray-200); }
.section-badge {
  background: var(--red-50);
  color: var(--red-700);
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid #F5B7B1;
  white-space: nowrap;
}

/* Tabs */
.tabs { margin-bottom: 1.375rem; }

.tab-list {
  display: flex;
  gap: 0.2rem;
  background: var(--white);
  border-radius: var(--radius);
  padding: 0.3rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  width: fit-content;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--gray-500);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.tab-btn.active           { background: var(--gradient-primary); color: white; box-shadow: var(--shadow-red); }
.tab-btn:not(.active):hover { background: var(--gray-100); color: var(--gray-700); }

.tab-count {
  background: var(--red-100);
  color: var(--red-700);
  font-size: 0.68rem;
  padding: 0.08rem 0.38rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}
.tab-btn.active .tab-count { background: rgba(255,255,255,0.22); color: white; }

.tab-panel          { display: none; }
.tab-panel.active   { display: block; }

/* Order Card */
.order-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.125rem;
  overflow: hidden;
  border: 1px solid var(--gray-100);
  transition: box-shadow 0.2s;
}
.order-card:hover { box-shadow: var(--shadow-lg); }

.order-card-header {
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.order-number {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--red-700);
  background: var(--red-50);
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-full);
  border: 1px solid #F5B7B1;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.order-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--gray-600);
}

.order-status {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.status-released { background: #EAFAF1; color: #1E8449; border: 1px solid #A9DFBF; }
.status-pending  { background: #FEFBF0; color: #9A7D0A; border: 1px solid #F9E79F; }
.status-partial  { background: #EBF5FB; color: #1A5276; border: 1px solid #AED6F1; }

/* Results Table */
.results-table-wrap { overflow-x: auto; padding: 0 1.25rem 1.25rem; }

.results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
  min-width: 560px;
}

.results-table th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.625rem 0.875rem;
  border-bottom: 2px solid var(--gray-200);
  text-align: left;
  white-space: nowrap;
}

.results-table td {
  padding: 0.68rem 0.875rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
.results-table tr:last-child td  { border-bottom: none; }
.results-table tr:hover td       { background: var(--gray-50); }

.result-value { font-weight: 600; font-size: 0.88rem; }
.flag-H       { color: #C0392B; }
.flag-L       { color: #2471A3; }

.flag-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.08rem 0.38rem;
  border-radius: var(--radius-xs);
  margin-left: 0.3rem;
}
.flag-badge-H { background: #FDEDEC; color: #C0392B; border: 1px solid #F5B7B1; }
.flag-badge-L { background: #EBF5FB; color: #1A5276; border: 1px solid #AED6F1; }

.no-results {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--gray-400);
  font-size: 0.86rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.no-results i { font-size: 2rem; opacity: 0.4; }

/* Cumulative header strip */
.cumulative-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--red-50) 0%, var(--white) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid #F5B7B1;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.125rem;
}
.cumulative-banner .card-header-icon { background: var(--red-100); }
.cumulative-banner h3 { font-size: 0.95rem; color: var(--gray-800); }
.cumulative-banner p  { font-size: 0.78rem; color: var(--gray-500); margin-top: 0.1rem; }

/* ── Full-Page Login (no-scroll split layout) ─────────────── */
.login-fullpage {
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  display: block;
}
@media (max-width: 860px) {
  .login-fullpage {
    height: auto;
    overflow: auto;
    min-height: 100vh;
  }
}

.lp-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: 100vh;
  overflow: hidden;
}
@media (max-width: 860px) {
  .lp-grid {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
}

/* Left brand panel */
.lp-brand {
  background: var(--gradient-hero);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1.75rem;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

.lp-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.lp-brand-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
}

.lp-logo-wrap { margin-bottom: 1.125rem; }

.lp-logo {
  width: 68px;
  height: 68px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.lp-clinic-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.lp-clinic-sub {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 400;
  margin-bottom: 0;
}

.lp-divider {
  width: 48px;
  height: 2px;
  background: rgba(255,255,255,0.3);
  margin: 1.375rem auto;
  border-radius: 2px;
}

.lp-feature-list { display: flex; flex-direction: column; gap: 0.875rem; text-align: left; }

.lp-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.12);
}

.lp-feature-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.lp-feature-title { font-size: 0.82rem; font-weight: 600; color: white; margin-bottom: 0.1rem; }
.lp-feature-desc  { font-size: 0.72rem; color: rgba(255,255,255,0.65); }

.lp-brand-footer {
  margin-top: 1.25rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
}
.lp-brand-footer a { color: rgba(255,255,255,0.7); }
.lp-brand-footer a:hover { color: white; }

/* Left-panel info sections */
.lp-left-section {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  margin-top: 0.75rem;
  text-align: left;
}

.lp-left-section-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}
.lp-left-section-title svg { fill: rgba(255,255,255,0.55); }

.lp-left-info-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.79rem;
  margin-bottom: 0.35rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.lp-left-info-key {
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  min-width: 72px;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.lp-left-info-val { color: rgba(255,255,255,0.7); line-height: 1.4; }
.lp-left-info-val strong { color: rgba(255,255,255,0.9); }

.lp-left-example {
  margin-top: 0.5rem;
  font-size: 0.77rem;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  border-radius: var(--radius-xs);
  padding: 0.3rem 0.6rem;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.lp-left-example-block {
  margin-top: 0.75rem;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-xs);
  padding: 0.55rem 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}
.lp-left-example-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  padding-top: 1px;
  min-width: 54px;
}
.lp-left-example-rows {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.lp-left-example-rows > div { font-size: 0.76rem; color: rgba(255,255,255,0.85); }
.lp-ex-key   { color: rgba(255,255,255,0.55); font-size: 0.72rem; }
.lp-ex-val   { font-weight: 600; }
.lp-ex-password {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  color: #fff;
}

.lp-left-advisory { border-left: 3px solid rgba(255,255,255,0.35); }

.lp-left-advisory-text {
  font-size: 0.79rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.6;
  margin-bottom: 0.6rem;
}
.lp-left-advisory-text strong { color: rgba(255,255,255,0.95); }

.lp-left-advisory-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.6);
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 0.5rem;
}
.lp-left-advisory-links strong { color: rgba(255,255,255,0.9); }
.lp-left-advisory-links a { color: rgba(255,255,255,0.75); }
.lp-left-advisory-links a:hover { color: white; }

/* Feature pills inside the login card */
.lp-card-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.lp-card-feat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.4rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  text-align: center;
}

.lp-card-feat-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--red-600), var(--red-400));
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.lp-card-feat span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gray-600);
  line-height: 1.2;
}

/* Right main panel */
.lp-main {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2rem 2.5rem;
}

.lp-main-inner {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  /* allow inner content to shrink on small screens */
  padding: 0.5rem 0;
}

/* Page title row */
.lp-page-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.lp-page-title i    { font-size: 1.5rem; color: var(--red-500); }
.lp-page-title h2   { font-size: 1.05rem; color: var(--gray-900); margin: 0; }
.lp-page-title p    { font-size: 0.75rem; color: var(--gray-400); margin: 0; font-weight: 400; }

/* Section boxes */
.lp-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-100);
}

.lp-section-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--red-600);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.75rem;
}
.lp-section-label i { font-size: 0.7rem; }

/* Info grid (How to login) */
.lp-info-grid { display: flex; flex-direction: column; gap: 0; }

.lp-info-item {
  display: flex;
  gap: 0.875rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.82rem;
}
.lp-info-item:last-child { border-bottom: none; padding-bottom: 0; }
.lp-info-item:first-child { padding-top: 0; }

.lp-info-key {
  font-weight: 700;
  color: var(--red-600);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 78px;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.lp-info-val { color: var(--gray-600); line-height: 1.6; }
.lp-info-val code {
  background: var(--gray-100);
  padding: 0.05rem 0.35rem;
  border-radius: var(--radius-xs);
  font-size: 0.77rem;
  color: var(--gray-700);
  font-family: 'Courier New', monospace;
}

.lp-example {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  background: var(--red-50);
  border: 1px solid #F5B7B1;
  color: var(--red-700);
  border-radius: var(--radius-xs);
  padding: 0.2rem 0.55rem;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

/* Advisory section */
.lp-advisory { border-left: 3px solid var(--red-400); }

.lp-advisory-text {
  font-size: 0.81rem;
  color: var(--gray-600);
  line-height: 1.65;
  margin-bottom: 0.625rem;
}

.lp-advisory-date {
  font-size: 0.72rem;
  color: var(--gray-400);
  font-style: italic;
}

.lp-advisory-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--gray-100);
  font-size: 0.78rem;
  color: var(--gray-500);
}
.lp-advisory-links i { color: var(--red-400); }
.lp-advisory-links a { font-size: 0.78rem; }

/* ── Print ────────────────────────────────────────────────── */
@page {
  size: A4 portrait;
  margin: 10mm 12mm;
}

@media print {
  .site-header,
  .patient-info-actions,
  .tabs,
  .site-footer,
  .section-title,
  .no-print { display: none !important; }

  html, body {
    width: 100%;
    height: auto;
    background: white;
    font-size: 10px;
  }

  .container   { max-width: 100%; padding: 0; }
  .page-content { padding: 0; }

  /* Clinic header */
  .print-header { display: block !important; margin-bottom: 6px; padding-bottom: 5px; }

  /* Patient info card — compact single row */
  .patient-info-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 10px;
    border: 1px solid #ccc;
    background: white !important;
    box-shadow: none !important;
    padding: 8px 10px !important;
    margin-bottom: 8px;
    page-break-inside: avoid;
    border-radius: 4px;
  }
  .patient-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 1rem !important;
    background: #7B1A1A !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    flex-shrink: 0;
  }
  .patient-details h2 { font-size: 0.95rem !important; margin-bottom: 2px; }
  .patient-meta       { gap: 6px !important; }
  .patient-meta-item  { font-size: 0.75rem !important; }

  /* Only show the currently active tab's latest result */
  .tab-panel          { display: none !important; }
  #tab-latest         { display: block !important; }

  /* Order card */
  .order-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    border-radius: 4px;
    margin-bottom: 8px;
    page-break-inside: avoid;
  }
  .order-card-header {
    padding: 6px 10px !important;
    gap: 8px !important;
    font-size: 0.78rem !important;
    flex-wrap: wrap;
  }

  /* Results table */
  .results-table-wrap { padding: 0 8px 8px !important; overflow: visible !important; }
  .results-table      { font-size: 0.75rem !important; width: 100% !important; }
  .results-table th   {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 4px 6px !important;
    font-size: 0.72rem !important;
  }
  .results-table td   { padding: 3px 6px !important; border-bottom: 1px solid #eee !important; }
  .results-table tr:last-child td { border-bottom: none !important; }

  .flag-badge { font-size: 0.65rem !important; padding: 1px 4px !important; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .login-hero                   { padding: 2.25rem 1.25rem 4rem; }
  .login-hero h1                { font-size: 1.45rem; }
  .header-text .clinic-name     { font-size: 0.88rem; }
  .patient-info-actions         { margin-left: 0; width: 100%; }
  .patient-info-card            { gap: 0.875rem; }
  .tab-list                     { width: 100%; }
  .tab-btn                      { flex: 1; text-align: center; justify-content: center; }
  .order-status                 { margin-left: 0; }
}

/* ── Login page — tablet (≤860px) ─────────────────────────── */
@media (max-width: 860px) {
  .lp-brand { align-items: center; }
  .lp-brand-inner { text-align: center; }
  .lp-logo-wrap { margin: 0 auto 0.75rem; }
  .lp-clinic-name { font-size: 1.3rem; }

  /* Side-by-side info boxes */
  .lp-info-sections-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
  }
  .lp-left-section { text-align: left; margin-top: 0; }
  .lp-left-info-row { flex-wrap: nowrap; }

  .lp-main-inner { max-width: 600px; margin: 0 auto; }
}

/* ── Login page — mobile (≤480px) ─────────────────────────── */
@media (max-width: 480px) {
  .lp-clinic-name { font-size: 1.15rem; }
  .lp-clinic-sub  { font-size: 0.65rem; }

  .lp-logo { width: 44px; height: 44px; }

  .lp-left-section { padding: 0.75rem 0.875rem; }
  .lp-left-example { font-size: 0.72rem; }

  .lp-section { padding: 1rem; }

  .lp-page-title h2 { font-size: 1.05rem; }
  .lp-page-title p  { font-size: 0.72rem; }
  .lp-page-title svg { width: 24px; height: 24px; }

  .form-input { font-size: 0.875rem; }

  .lp-card-features { grid-template-columns: repeat(3,1fr); gap: 0.375rem; }
  .lp-card-feat span { font-size: 0.62rem; }
  .lp-card-feat-icon { width: 24px; height: 24px; }
  .lp-card-feat-icon svg { width: 11px; height: 11px; }

  /* Dashboard responsive */
  .site-header { padding: 0 1rem; }
  .header-actions .btn span { display: none; }
  .order-card { padding: 1rem; }
  .results-table th, .results-table td { padding: 0.4rem 0.5rem; font-size: 0.75rem; }
  .patient-info-card { flex-direction: column; }

  /* Header nav on small screens */
  .header-inner { padding: 0.75rem 1rem; }
  .header-text .clinic-name { font-size: 0.82rem; }
  .header-text .clinic-sub  { display: none; }
  .header-badge { display: none; }

  /* Order cards on small screens */
  .order-card-header { flex-wrap: wrap; gap: 0.5rem; }
  .order-meta { font-size: 0.75rem; }
  .results-table { min-width: 0; }
  .results-table-wrap { padding: 0 0.75rem 0.75rem; }
}

/* ── Global small screen helpers ──────────────────────────── */
@media (max-width: 380px) {
  .lp-page-title h2 { font-size: 0.95rem; }
  .lp-page-title p  { display: none; }
  .btn-lg { font-size: 0.82rem; }
  .header-logo { width: 36px; height: 36px; }
}
