/* =========================================================
   med.dev — Global Design System (Navy/Sky Edition)
   =========================================================
   Palette:
     Primary:  #355872 (navy blue)
     Mid:      #7AAACE (cornflower blue)
     Accent:   #9CD5FF (sky blue light)
     BG:       #F7F8F0 (cream/off-white)
     Error:    #E94F37 / #FF6B6B
     Success:  #3CB371 (medium sea green)
   ========================================================= */
:root {
  /* Brand Core */
  --primary:        #355872;
  --primary-hover:  #2a4760;
  --primary-mid:    #7AAACE;
  --primary-light:  #9CD5FF;
  --primary-soft:   #edf5fc;

  /* CTA  (Start / Submit / Upgrade only) */
  --cta:       #E94F37;
  --cta-alt:   #FF6B6B;
  --cta-hover: #c73e28;

  /* Backgrounds */
  --bg:        #F7F8F0;
  --bg-light:  #ffffff;
  --card:      #ffffff;

  /* Borders & Text */
  --border:    #dde3e9;
  --text:      #1a2535;
  --muted:     #6b7a90;

  /* Status */
  --success: #3CB371;
  --warning: #f59e0b;
  --danger:  #E94F37;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(53,88,114,0.07), 0 1px 2px rgba(53,88,114,0.04);
  --shadow-md: 0 4px 14px rgba(53,88,114,0.10);
  --shadow-lg: 0 10px 32px rgba(53,88,114,0.12);
  --radius:    16px;
  --radius-sm: 10px;

  /* Focus ring */
  --focus: 0 0 0 3px rgba(156,213,255,0.5);
}

/* ─── Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  overscroll-behavior-x: none;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--radius-sm);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
}
.btn:hover  { transform: scale(1.02); }
.btn:active { transform: scale(0.99); opacity: 0.95; }

/* Primary — navy */
.btn-primary {
  background: linear-gradient(135deg, #355872, #4a7a9b);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(53,88,114,0.28);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #2a4760, #355872);
  box-shadow: 0 4px 14px rgba(53,88,114,0.38);
}

/* CTA — red/coral (Upgrade, Start, Submit ONLY) */
.btn-cta {
  background: linear-gradient(135deg, #E94F37, #FF6B6B);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(233,79,55,0.28);
}
.btn-cta:hover {
  background: linear-gradient(135deg, #c73e28, #E94F37);
  box-shadow: 0 4px 14px rgba(233,79,55,0.38);
}

/* Secondary / Outline */
.btn-secondary, .btn-outline {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover, .btn-outline:hover {
  background: var(--bg);
  border-color: #b0bec9;
}

/* Icon button */
.icon-btn {
  background: #fff;
  border: 1.5px solid var(--border);
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  color: var(--muted);
}
.icon-btn:hover { background: var(--bg); border-color: #b0bec9; color: var(--text); }

/* ─── Cards ───────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ─── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-neutral { background: #edf1f5; color: #6b7a90; }
.badge-primary { background: #edf5fc; color: #355872; }
.badge-success { background: #d6f0e3; color: #2a7a50; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fde8e4; color: #c73e28; }

/* ─── Flash Messages ──────────────────────────────────── */
.flash-msg {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 12px 0;
  font-size: 14px;
  font-weight: 500;
}
.flash-success { background: rgba(60,179,113,0.10); border-color: rgba(60,179,113,0.28); color: #2a7a50; }
.flash-error   { background: rgba(233,79,55,0.10);  border-color: rgba(233,79,55,0.28);  color: #c73e28; }
.flash-warning { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.28); color: #92400e; }

/* ─── Modals ──────────────────────────────────────────── */
.backdrop {
  position: fixed; inset: 0;
  background: rgba(26,37,53,0.42);
  display: none; z-index: 1000;
  backdrop-filter: blur(2px);
}
.backdrop.show { display: block; }

.modal {
  position: fixed; inset: 0;
  display: none; z-index: 1001;
  align-items: center; justify-content: center; padding: 20px;
}
.modal.show { display: flex; }

.modal-card {
  width: 100%; max-width: 560px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--text); }
.modal-body { padding: 20px; }
.modal-actions {
  display: flex; gap: 10px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ─── Utility ─────────────────────────────────────────── */
.muted        { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger);  }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }

.sr-only {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}