/* ==========================================================================
   MedPin for Doctors — demo request page
   Tokens sampled from medpin.in's own brand ramp for visual continuity.
   ========================================================================== */

:root {
  --brand-950: #04173D;
  --brand-900: #052459;
  --brand-800: #012A78;
  --brand-700: #013696;
  --brand-600: #0B4CB8;
  --brand-500: #1E6FDB;
  --brand-400: #4D9AF9;
  --brand-300: #7FB6FC;
  --brand-200: #A9CDFD;
  --brand-100: #CFE2FE;
  --brand-50:  #E9F1FD;

  --bg:            #FFFFFF;
  --bg-soft:       #EFF5FE;
  --surface:       #FFFFFF;
  --surface-2:     #F7FAFF;
  --fg:            #0A1F4A;
  --fg-muted:      #4A6291;
  --border:        #DCE7F8;
  --border-strong: #BED3F2;
  --primary:       #013696;
  --primary-hover: #012A78;
  --on-primary:    #FFFFFF;
  --accent:        #1E6FDB;
  --ring:          #1E6FDB;
  --good:          #0E7C51;
  --warn:          #A45B06;
  --danger:        #B3261E;
  --grad: linear-gradient(100deg, #013696, #2E86F0);

  --shadow-sm: 0 1px 2px rgba(4, 23, 61, .06), 0 1px 3px rgba(4, 23, 61, .05);
  --shadow-md: 0 4px 12px rgba(4, 23, 61, .08), 0 12px 28px rgba(4, 23, 61, .06);
  --shadow-lg: 0 18px 48px rgba(4, 23, 61, .15), 0 4px 12px rgba(4, 23, 61, .07);

  --space-1: .25rem;  --space-2: .5rem;   --space-3: .75rem;
  --space-4: 1rem;    --space-5: 1.5rem;  --space-6: 2rem;
  --space-7: 3rem;    --space-8: 4rem;    --space-9: 6rem;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 26px;
  --radius-xl: 34px;

  --container: 1100px;
  --header-h: 72px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 220ms;

  color-scheme: light;
}

/* Light-only by deliberate choice, matching medpin.in's own brand rule: the
   navy/blue ramp is tuned against a white ground and loses contrast inverted. */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Noto Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: Figtree, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 var(--space-4);
  color: var(--fg);
  text-wrap: balance;
}

p { margin: 0 0 var(--space-4); }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

:focus-visible {
  outline: 2.5px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: var(--on-primary);
  padding: var(--space-3) var(--space-5);
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ══ Buttons ══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: Figtree, sans-serif;
  font-weight: 700;
  font-size: .9rem;
  padding: .65rem 1.35rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); }
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-soft); }
.btn-lg { padding: .9rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: .4rem .9rem; font-size: .8rem; }
.btn-block { width: 100%; }

/* ══ Header ══ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; }
.brand-mark { border-radius: 9px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: Figtree, sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--fg); }
.brand-tag { font-family: Quicksand, sans-serif; font-weight: 600; font-size: .7rem; color: var(--fg-muted); letter-spacing: .02em; }

.back-link {
  font-size: .875rem;
  font-weight: 600;
  color: var(--fg-muted);
  transition: color var(--dur) var(--ease);
}
.back-link:hover { color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: var(--space-5); }

/* ══ Eyebrow ══ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: Quicksand, sans-serif;
  font-weight: 700;
  font-size: .8125rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 var(--space-4);
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(14, 124, 81, .18);
}

.section { padding-block: var(--space-8); }

/* ══ Page intro ══ */
.page-intro { padding-block: var(--space-8) var(--space-7); }
.page-intro h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.9rem); max-width: 18ch; }
.page-intro .lead { font-size: 1.1rem; color: var(--fg-muted); max-width: 60ch; }

.stat-row { display: flex; gap: var(--space-7); flex-wrap: wrap; margin-top: var(--space-6); }
.stat dt { font-family: Quicksand, sans-serif; font-weight: 700; font-size: 1.4rem; color: var(--primary); }
.stat dd { font-size: .8rem; color: var(--fg-muted); }

/* ══ Demo form section ══ */
.demo-section { border-top: 1px solid var(--border); background: var(--bg-soft); }
.demo-inner {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: var(--space-8);
  align-items: start;
}
.demo-copy { position: sticky; top: calc(var(--header-h) + var(--space-6)); }
.expect-list { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-2); }
.expect-list li {
  padding-left: var(--space-5);
  position: relative;
  font-size: .95rem;
  color: var(--fg-muted);
}
.expect-list li::before {
  content: "";
  position: absolute;
  left: 0; top: .5em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.expect-list strong { color: var(--fg); }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-lg);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
}
.field { display: flex; flex-direction: column; gap: .4rem; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 600; color: var(--fg); }
.field .optional { font-weight: 400; color: var(--fg-muted); }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: .95rem;
  padding: .7rem .85rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--fg);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  background: var(--bg);
  outline: none;
}
.field textarea { resize: vertical; min-height: 4.5rem; }
.field input:user-invalid, .field select:user-invalid { border-color: var(--danger); }

.consent {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .85rem;
  color: var(--fg-muted);
  margin-bottom: var(--space-5);
  cursor: pointer;
}
.consent input { margin-top: .2rem; accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }

.form-note { text-align: center; font-size: .8rem; color: var(--fg-muted); margin: var(--space-3) 0 0; }

.form-success { text-align: center; padding-block: var(--space-6); }
.success-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(14, 124, 81, .12);
  color: var(--good);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-4);
}
.success-icon svg { width: 28px; height: 28px; stroke: currentColor; stroke-width: 2.5; fill: none; }
.form-success h3 { font-size: 1.3rem; }
.form-success p { color: var(--fg-muted); max-width: 40ch; margin-inline: auto; }
.form-success .btn { margin-top: var(--space-4); }

/* ══ Footer ══ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: var(--space-6);
}
.footer-inner-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.footer-contact { display: flex; gap: var(--space-5); }
.footer-contact a { font-size: .875rem; color: var(--fg-muted); }
.footer-contact a:hover { color: var(--primary); }

/* ══ Auth (login) ══ */
.auth-body { background: var(--bg-soft); }
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-7);
}
.auth-brand { margin-bottom: var(--space-6); }
.auth-card h1 { font-size: 1.5rem; margin-bottom: var(--space-2); }
.auth-lead { color: var(--fg-muted); font-size: .95rem; margin-bottom: var(--space-5); }
.auth-error {
  background: rgba(179, 38, 30, .08);
  color: var(--danger);
  border: 1px solid rgba(179, 38, 30, .25);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: .875rem;
  margin-bottom: var(--space-5);
}
.auth-success {
  background: rgba(14, 124, 81, .08);
  color: var(--good);
  border: 1px solid rgba(14, 124, 81, .25);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: .875rem;
  margin-bottom: var(--space-5);
}
.auth-back {
  display: inline-block;
  margin-top: var(--space-6);
  font-size: .85rem;
  color: var(--fg-muted);
}
.auth-back:hover { color: var(--primary); }

/* ══ Admin dashboard ══ */
.admin-main { padding-block: var(--space-7); }
.admin-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.admin-title { font-size: 1.6rem; margin-bottom: var(--space-1); }
.admin-count { color: var(--fg-muted); font-size: .9rem; margin: 0; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; white-space: nowrap; }
.admin-table th {
  text-align: left;
  font-family: Quicksand, sans-serif;
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--fg-muted);
  background: var(--surface-2);
  padding: var(--space-3) var(--space-4);
  position: sticky;
  top: 0;
}
.admin-table td {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  vertical-align: top;
}
.admin-table tr:hover td { background: var(--bg-soft); }
.admin-table .admin-ref { color: var(--fg-muted); font-size: .78rem; }
.admin-table .admin-notes { white-space: normal; max-width: 26ch; color: var(--fg-muted); }
.admin-empty {
  text-align: center;
  color: var(--fg-muted);
  padding: var(--space-8) var(--space-4);
}

.admin-toolbar-actions { display: flex; align-items: center; gap: var(--space-3); }

.badge {
  display: inline-block;
  font-family: Quicksand, sans-serif;
  font-weight: 700;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .2rem .55rem;
  border-radius: 999px;
}
.badge-web { background: var(--brand-50); color: var(--primary); }
.badge-manual { background: rgba(164, 91, 6, .12); color: var(--warn); }

/* ══ Add/edit dialog ══ */
.admin-dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  color: var(--fg);
  width: min(640px, calc(100% - 2.5rem));
  max-height: min(88vh, 720px);
  overflow-y: auto;
}
.admin-dialog::backdrop { background: rgba(4, 23, 61, .45); }
.admin-dialog h2 { font-size: 1.3rem; margin-bottom: var(--space-5); }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* ══ Responsive ══ */
@media (max-width: 820px) {
  .demo-inner { grid-template-columns: 1fr; }
  .demo-copy { position: static; }
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .stat-row { gap: var(--space-5); }
  .container { padding-inline: var(--space-4); }
  .footer-inner-simple { justify-content: center; text-align: center; }
  .auth-card { padding: var(--space-6) var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
