/* MediPage Design System - Based on Velyos adapted for healthcare */
:root {
  /* Brand blue */
  --brand-50: #f0f5ff;
  --brand-100: #e0ebfd;
  --brand-200: #b5cbfa;
  --brand-300: #7ca2f5;
  --brand-400: #4a7ff0;
  --brand-500: #1e56d9;
  --brand-600: #0f3a9e;
  --brand-700: #0a2668;
  --brand-800: #061a47;
  --brand-900: #03102b;

  /* Accent - default orange, swappable via theme */
  --accent-100: #ffe8d6;
  --accent-200: #ffcfa3;
  --accent-300: #ffb478;
  --accent-400: #ff9447;
  --accent-500: #ff7a1a;
  --accent-600: #d85a00;
  --accent-700: #b04500;
  --accent-800: #823400;

  /* Light surfaces */
  --bg: #f4f7fc;
  --bg-elevated: #ffffff;
  --surface-1: #ffffff;
  --surface-2: #fafbff;
  --surface-3: #eef2f9;
  --surface-muted: #e6ecf5;
  --surface-border: rgba(15, 58, 158, 0.12);
  --surface-border-strong: rgba(15, 58, 158, 0.25);

  --text-primary: #03102b;
  --text-body: #2a3659;
  --text-muted: #6b7797;
  --text-on-brand: #ffffff;
  --text-on-accent: #ffffff;

  --success: #0f9d5a;
  --success-bg: rgba(15, 157, 90, 0.1);
  --warning: #c27803;
  --warning-bg: rgba(194, 120, 3, 0.1);
  --error: #dc2626;
  --error-bg: rgba(220, 38, 38, 0.08);
  --info: #1e56d9;
  --info-bg: rgba(30, 86, 217, 0.08);

  --gradient-brand: linear-gradient(135deg, #1e56d9 0%, #0f3a9e 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent-500) 0%, var(--accent-600) 100%);
  --gradient-cta: linear-gradient(135deg, var(--accent-600) 0%, var(--accent-700) 100%);
  --gradient-hero: linear-gradient(135deg, #1e56d9 0%, #4a7ff0 60%, var(--accent-500) 100%);
  --gradient-surface: linear-gradient(145deg, #ffffff 0%, #fafbff 100%);

  --glow-orange: color-mix(in srgb, var(--accent-500) 35%, transparent);
  --glow-orange-soft: color-mix(in srgb, var(--accent-500) 15%, transparent);
  --glow-blue: rgba(30, 86, 217, 0.22);
  --glow-blue-soft: rgba(30, 86, 217, 0.1);

  --shadow-xs: 0 1px 2px rgba(3, 16, 43, 0.04);
  --shadow-sm: 0 2px 4px rgba(3, 16, 43, 0.06);
  --shadow-md: 0 4px 12px rgba(3, 16, 43, 0.08);
  --shadow-lg: 0 12px 32px rgba(3, 16, 43, 0.1);
  --shadow-xl: 0 20px 48px rgba(3, 16, 43, 0.12);
  --shadow-glow: 0 4px 24px var(--glow-orange);
  --shadow-glow-blue: 0 4px 24px var(--glow-blue);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 999px;

  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg: #050d22;
  --bg-elevated: #0a1838;
  --surface-1: #0e1f45;
  --surface-2: #142b5c;
  --surface-3: #0a1838;
  --surface-muted: #081432;
  --surface-border: rgba(124, 162, 245, 0.14);
  --surface-border-strong: rgba(124, 162, 245, 0.26);
  --text-primary: #f0f5ff;
  --text-body: #b5cbfa;
  --text-muted: #7c8db5;
  --gradient-surface: linear-gradient(145deg, #0a1838 0%, #061a47 100%);
  --glow-blue: rgba(74, 127, 240, 0.25);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.5);
}

/* Accent presets (tweakable) */
[data-accent="teal"] {
  --accent-300: #5eead4;
  --accent-400: #2dd4bf;
  --accent-500: #14b8a6;
  --accent-600: #0d9488;
  --accent-700: #0f766e;
}
[data-accent="violet"] {
  --accent-300: #c4b5fd;
  --accent-400: #a78bfa;
  --accent-500: #8b5cf6;
  --accent-600: #7c3aed;
  --accent-700: #6d28d9;
}
[data-accent="coral"] {
  --accent-300: #fda4af;
  --accent-400: #fb7185;
  --accent-500: #f43f5e;
  --accent-600: #e11d48;
  --accent-700: #be123c;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.mono { font-family: var(--font-mono); }

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1;
  white-space: nowrap;
}
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 13px 22px; font-size: 0.95rem; }
.btn-primary { background: var(--gradient-cta); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px var(--glow-orange); }
.btn-secondary { background: var(--gradient-brand); color: #fff; }
.btn-secondary:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--surface-border-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--brand-500); }
.btn-soft { background: var(--surface-3); color: var(--text-primary); }
.btn-soft:hover { background: var(--surface-muted); }
.btn-danger { background: var(--error); color: #fff; }

/* Badges */
.badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}
.badge-brand { background: color-mix(in srgb, var(--brand-500) 12%, transparent); color: var(--brand-600); border: 1px solid color-mix(in srgb, var(--brand-500) 25%, transparent); }
.badge-accent { background: color-mix(in srgb, var(--accent-500) 15%, transparent); color: var(--accent-700); border: 1px solid color-mix(in srgb, var(--accent-500) 30%, transparent); }
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); }
.badge-error { background: var(--error-bg); color: var(--error); border: 1px solid color-mix(in srgb, var(--error) 30%, transparent); }
.badge-neutral { background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--surface-border); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }

/* Cards */
.card { background: var(--surface-1); border: 1px solid var(--surface-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }

/* Inputs */
.input {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border-strong);
  background: var(--surface-1);
  color: var(--text-primary);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 18%, transparent); }

/* Logo */
.logo-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}
.logo-wordmark .dot {
  display: inline-block;
  width: 0.2em; height: 0.2em;
  background: var(--accent-600);
  margin: 0 0.05em 0 0.02em;
  transform: translateY(-0.08em);
  border-radius: 1px;
  align-self: flex-end;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-muted); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-border-strong); }

/* Utility */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-accent { color: var(--accent-600); }
.text-brand { color: var(--brand-600); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-xs { font-size: 0.72rem; } .text-sm { font-size: 0.82rem; } .text-md { font-size: 1rem; } .text-lg { font-size: 1.125rem; } .text-xl { font-size: 1.35rem; } .text-2xl { font-size: 1.75rem; }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.divider { height: 1px; background: var(--surface-border); width: 100%; }

/* Ambient glow */
.glow-bg {
  position: relative;
}
.glow-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 15% 5%, var(--glow-orange-soft) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 85% 95%, var(--glow-blue-soft) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}
