@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --color-background: #f0f7f4;
  --color-surface: #ffffff;
  --color-surface-variant: #e2eff0;
  --color-primary: #0d7377;
  --color-primary-dark: #0a5c5f;
  --color-primary-light: #14a7ad;
  --color-accent: #e8a87c;
  --color-accent-dark: #c98a5e;
  --color-on-background: #1a2e2e;
  --color-on-primary: #ffffff;
  --color-text-muted: #5a7878;
  --color-border: #cce0e0;
  --color-success: #2e7d5e;
  --color-error: #c0392b;
  --color-warning: #e67e22;

  --font-headline: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  --shadow-sm: 0 2px 8px rgba(13, 115, 119, 0.08);
  --shadow-md: 0 8px 24px rgba(13, 115, 119, 0.12);
  --shadow-lg: 0 16px 48px rgba(13, 115, 119, 0.16);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--color-background);
  color: var(--color-on-background);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.anim-fade-up   { animation: fadeInUp 0.6s ease both; }
.anim-fade      { animation: fadeIn   0.5s ease both; }
.anim-slide-right { animation: slideInRight 0.5s ease both; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.35s; }
.delay-4 { animation-delay: 0.5s; }
.delay-5 { animation-delay: 0.65s; }

/* ── Typography ── */
h1, h2, h3, h4 { font-family: var(--font-headline); line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { font-weight: 300; }

/* ── Layout ── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.section   { padding: 80px 0; }

/* ── Navigation ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(240, 247, 244, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 68px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-headline); font-size: 1.25rem; font-weight: 700;
  color: var(--color-primary); text-decoration: none;
}
.nav-brand-icon {
  width: 36px; height: 36px; background: var(--color-primary);
  border-radius: var(--radius-sm); display: flex; align-items: center;
  justify-content: center; color: white; font-size: 18px;
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-user    { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 0.9rem; }
.nav-avatar  {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--color-primary-light);
  background: var(--color-surface-variant);
}
.nav-avatar-placeholder {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.85rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 500;
  border: none; cursor: pointer; text-decoration: none;
  transition: all var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary); color: var(--color-on-primary);
  box-shadow: 0 4px 16px rgba(13, 115, 119, 0.3);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 6px 20px rgba(13, 115, 119, 0.4);
  transform: translateY(-2px);
}
.btn-accent {
  background: var(--color-accent); color: #fff;
  box-shadow: 0 4px 16px rgba(232, 168, 124, 0.3);
}
.btn-accent:hover {
  background: var(--color-accent-dark);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent; color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary); color: white;
}
.btn-ghost {
  background: transparent; color: var(--color-text-muted);
  padding: 8px 16px;
}
.btn-ghost:hover { background: var(--color-surface-variant); color: var(--color-on-background); }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-danger { background: var(--color-error); color: white; }
.btn-success { background: var(--color-success); color: white; }

/* ── Cards ── */
.card {
  background: var(--color-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 28px;
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ── Hero (landing) ── */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding: 120px 0 80px;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(20, 167, 173, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(232, 168, 124, 0.12) 0%, transparent 55%),
    var(--color-background);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -100px; right: -100px;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 115, 119, 0.08), transparent 70%);
  pointer-events: none;
}
.hero-content { max-width: 600px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(13, 115, 119, 0.1); color: var(--color-primary);
  padding: 6px 16px; border-radius: 999px; font-size: 0.85rem;
  font-weight: 500; margin-bottom: 24px; border: 1px solid rgba(13, 115, 119, 0.2);
}
.hero-title { color: var(--color-on-background); margin-bottom: 20px; }
.hero-title span { color: var(--color-primary); }
.hero-subtitle {
  font-size: 1.1rem; color: var(--color-text-muted); margin-bottom: 40px; max-width: 480px;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-visual {
  position: relative; display: flex; justify-content: center; align-items: center;
}
.hero-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}

.feature-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.feature-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--color-surface); padding: 6px 14px;
  border-radius: 999px; font-size: 0.8rem; font-weight: 500;
  color: var(--color-on-background); box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}
.feature-chip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-primary);
}

/* ── Visual card stack ── */
.visual-stack { position: relative; width: 340px; height: 400px; }
.visual-card {
  position: absolute; background: var(--color-surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border); padding: 20px;
}
.visual-card-main {
  width: 300px; top: 40px; left: 20px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white; border: none;
}
.visual-card-float {
  width: 220px; bottom: 20px; right: 0;
  z-index: 2;
}
.visual-card-label { font-size: 0.7rem; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.visual-card-value { font-family: var(--font-headline); font-size: 1.1rem; font-weight: 600; }
.visual-divider { border: none; border-top: 1px solid rgba(255,255,255,0.2); margin: 14px 0; }
.visual-row { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; }
.visual-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.2); padding: 4px 12px;
  border-radius: 999px; font-size: 0.75rem;
}
.visual-check { color: #4ade80; font-size: 0.85rem; }

/* ── How it works ── */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; margin-top: 48px; }
.step-card { text-align: center; padding: 40px 24px; }
.step-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(13, 115, 119, 0.25);
}
.step-number {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  color: var(--color-primary); text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.step-title { font-family: var(--font-headline); font-size: 1.1rem; margin-bottom: 10px; }
.step-desc { font-size: 0.9rem; color: var(--color-text-muted); }

/* ── Dashboard ── */
.dashboard-layout {
  display: grid; grid-template-columns: 260px 1fr; gap: 32px;
  min-height: calc(100vh - 68px); padding-top: 68px;
}
.sidebar {
  background: var(--color-surface); border-right: 1px solid var(--color-border);
  padding: 32px 20px; position: sticky; top: 68px; height: calc(100vh - 68px);
  overflow-y: auto;
}
.sidebar-section { margin-bottom: 32px; }
.sidebar-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--color-text-muted); margin-bottom: 8px;
  padding: 0 8px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition); color: var(--color-on-background);
  text-decoration: none; border: none; background: none; width: 100%;
}
.sidebar-link:hover { background: var(--color-surface-variant); color: var(--color-primary); }
.sidebar-link.active { background: rgba(13, 115, 119, 0.1); color: var(--color-primary); }
.sidebar-link-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.main-content { padding: 32px; overflow-y: auto; }

/* ── Patient info panel ── */
.patient-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: var(--radius-lg); color: white; padding: 28px 32px;
  display: flex; align-items: center; gap: 24px; margin-bottom: 28px;
  box-shadow: var(--shadow-md);
}
.patient-portrait {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; border: 3px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.patient-portrait-placeholder {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,0.2); border: 3px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; flex-shrink: 0;
}
.patient-info { flex: 1; }
.patient-name  { font-family: var(--font-headline); font-size: 1.6rem; font-weight: 700; }
.patient-meta  { opacity: 0.85; font-size: 0.9rem; margin-top: 4px; }
.patient-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.2); padding: 6px 14px;
  border-radius: 999px; font-size: 0.8rem; font-weight: 500; margin-top: 10px;
}

/* ── Claims ── */
.claims-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.claim-item {
  background: var(--color-surface-variant); border-radius: var(--radius-sm);
  padding: 12px 16px; border: 1px solid var(--color-border);
}
.claim-item strong {
  display: block; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-text-muted); margin-bottom: 4px;
}
.claim-item span { font-weight: 500; font-size: 0.9rem; }

/* ── Prescription panel ── */
.rx-panel { margin-top: 28px; }
.rx-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.rx-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.form-input, .form-select, .form-textarea {
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border); background: var(--color-surface);
  font-family: var(--font-body); font-size: 0.9rem;
  color: var(--color-on-background); transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.1);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* ── QR modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(26, 46, 46, 0.6);
  backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--color-surface); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); max-width: 520px; width: 90%;
  padding: 40px; position: relative; animation: fadeInUp 0.3s ease;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--color-surface-variant); border: none; cursor: pointer;
  border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--color-text-muted);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--color-border); color: var(--color-on-background); }
.modal-title { font-family: var(--font-headline); font-size: 1.5rem; margin-bottom: 8px; }
.modal-sub   { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 28px; }
.qr-wrapper  {
  background: var(--color-background); border-radius: var(--radius-lg);
  padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 16px;
  border: 1px solid var(--color-border);
}
.qr-code-img { width: 220px; height: 220px; border-radius: var(--radius-sm); }
.qr-label    { font-size: 0.85rem; color: var(--color-text-muted); text-align: center; max-width: 300px; }
.qr-steps    { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.qr-step     { display: flex; align-items: flex-start; gap: 12px; font-size: 0.85rem; }
.qr-step-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--color-primary);
  color: white; font-size: 0.75rem; font-weight: 600; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.qr-loading {
  width: 220px; height: 220px; display: flex; align-items: center;
  justify-content: center; background: var(--color-surface-variant);
  border-radius: var(--radius-sm);
}
.qr-spinner {
  width: 40px; height: 40px; border: 3px solid var(--color-border);
  border-top-color: var(--color-primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Pharmacist ── */
.pharmacist-hero {
  background: linear-gradient(135deg, #1a4a4a 0%, var(--color-primary) 100%);
  color: white; padding: 48px 40px; border-radius: var(--radius-xl);
  margin-bottom: 32px; position: relative; overflow: hidden;
}
.pharmacist-hero::after {
  content: '💊'; position: absolute; right: 40px; bottom: -10px;
  font-size: 8rem; opacity: 0.1;
}
.pharmacist-verify-zone {
  border: 2px dashed var(--color-border); border-radius: var(--radius-lg);
  padding: 48px; text-align: center; background: var(--color-surface);
  transition: all var(--transition);
}
.pharmacist-verify-zone:hover { border-color: var(--color-primary); background: rgba(13,115,119,0.02); }
.pharmacist-verify-icon { font-size: 3rem; margin-bottom: 16px; }

/* ── Status badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
}
.badge-success { background: rgba(46, 125, 94, 0.12); color: var(--color-success); }
.badge-pending { background: rgba(230, 126, 34, 0.12); color: var(--color-warning); }
.badge-info    { background: rgba(13, 115, 119, 0.12); color: var(--color-primary); }

/* ── Section headers ── */
.section-header { text-align: center; margin-bottom: 48px; }
.section-eyebrow {
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--color-primary); margin-bottom: 12px;
}
.section-title { margin-bottom: 16px; }
.section-desc { font-size: 1rem; color: var(--color-text-muted); max-width: 560px; margin: 0 auto; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--color-border); margin: 24px 0; }

/* ── Footer ── */
.footer {
  background: var(--color-on-background); color: rgba(255,255,255,0.6);
  padding: 40px 0; text-align: center; font-size: 0.85rem;
}
.footer-brand { color: white; font-family: var(--font-headline); font-size: 1.1rem; margin-bottom: 8px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-layout { grid-template-columns: 1fr; }
  .hero-visual  { display: none; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .rx-form { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .hero { padding: 100px 0 60px; }
  .section { padding: 60px 0; }
  .patient-banner { flex-direction: column; text-align: center; }
  .steps-grid { grid-template-columns: 1fr; }
  .claims-grid { grid-template-columns: 1fr; }
}
