/* ============================================================
   Mascot Healthcare — Blue theme (scan-to-hub)
   ============================================================ */
:root {
  --blue-900: #062a63;
  --blue-800: #0a3d8f;
  --blue-700: #0a4fb4;
  --blue-600: #1565d8;
  --blue-500: #2b7cf0;
  --blue-400: #5b9bf7;
  --blue-300: #9cc4fb;
  --sky-50:  #eef5ff;
  --sky-100: #dceaff;
  --ink:     #0c1a35;
  --ink-soft:#42547a;
  --line:    #e3ecfb;
  --white:   #ffffff;
  --card-shadow: 0 14px 40px -18px rgba(10, 79, 180, .35);
  --card-shadow-hover: 0 22px 55px -16px rgba(10, 79, 180, .45);
  --radius: 22px;
  --radius-sm: 14px;
  --grad: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  --grad-soft: linear-gradient(135deg, #eaf2ff, #f6faff);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: radial-gradient(120% 120% at 50% 0%, #f3f8ff 0%, #e9f1fe 45%, #e2ecfd 100%);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Decorative orbs ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(48px); opacity: .55; }
.orb-1 { width: 360px; height: 360px; background: #8fc0ff; top: -120px; right: -90px; }
.orb-2 { width: 300px; height: 300px; background: #b9d6ff; bottom: 4%; left: -110px; opacity: .5; }
.orb-3 { width: 220px; height: 220px; background: #5b9bf7; top: 38%; right: -70px; opacity: .35; }

/* ---------- App shell ---------- */
.app {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 18px 40px;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--grad);
  color: #fff;
  border-radius: 28px;
  padding: 22px 22px 26px;
  box-shadow: 0 24px 60px -22px rgba(10, 60, 143, .6);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 60% at 85% 0%, rgba(255,255,255,.22), transparent 60%);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center; color: #fff;
  backdrop-filter: blur(4px);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.02rem; letter-spacing: -.2px; }
.brand-tag { font-size: .76rem; opacity: .8; }

.welcome { margin-top: 24px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.16);
  padding: 6px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #5dffa8; box-shadow: 0 0 0 4px rgba(93,255,168,.25); }
.welcome h1 { margin-top: 14px; font-size: 1.72rem; font-weight: 800; letter-spacing: -.6px; line-height: 1.18; }
.subtitle { margin-top: 10px; opacity: .9; font-size: .94rem; max-width: 46ch; }

.stats { display: flex; gap: 10px; margin-top: 22px; }
.stat {
  flex: 1; background: rgba(255,255,255,.13); border-radius: 16px;
  padding: 12px 8px; text-align: center; backdrop-filter: blur(4px);
}
.stat strong { display: block; font-size: 1.18rem; font-weight: 800; }
.stat span { font-size: .72rem; opacity: .82; }

/* ---------- Feature grid ---------- */
.grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  appearance: none; border: 1px solid var(--line); cursor: pointer;
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 15px;
  text-align: left;
  display: flex; flex-direction: column; gap: 3px;
  box-shadow: var(--card-shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); border-color: var(--blue-300); }
.card:active { transform: translateY(-1px) scale(.99); }
.card:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 2px; }

.card-icon {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--grad-soft);
  display: grid; place-items: center; margin-bottom: 8px;
  color: var(--blue-700);
}
.card-icon svg { width: 24px; height: 24px; }
.card-title { font-weight: 700; font-size: .98rem; letter-spacing: -.2px; }
.card-sub { font-size: .8rem; color: var(--ink-soft); }
.card-go {
  position: absolute; top: 14px; right: 15px;
  font-size: .9rem; color: var(--blue-400); font-weight: 700;
  opacity: 0; transform: translate(-2px, 2px); transition: all .18s;
}
.card:hover .card-go { opacity: 1; transform: translate(0, 0); }

/* ---------- Social ---------- */
.social { margin-top: 26px; text-align: center; }
.social-label { font-size: .82rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 12px; }
.social-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.social-btn {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--white); border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
  color: var(--blue-700); transition: transform .15s, box-shadow .15s;
}
.social-btn:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }
.social-btn svg { width: 22px; height: 22px; }

/* ---------- Footer ---------- */
.foot { margin-top: 30px; text-align: center; color: var(--ink-soft); font-size: .82rem; }
.foot p { margin-bottom: 8px; }
.admin-link { color: var(--blue-700); font-weight: 600; text-decoration: none; }
.admin-link:hover { text-decoration: underline; }

/* ============================================================
   Sheet / modal (Feedback)
   ============================================================ */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(8, 24, 56, .42); backdrop-filter: blur(3px);
  animation: fade .2s ease;
}
.sheet {
  position: fixed; z-index: 50;
  left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 540px;
  max-height: 90dvh; overflow: hidden;
  background: var(--white);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 60px -20px rgba(8, 24, 56, .4);
  display: flex; flex-direction: column;
  animation: slideUp .28s cubic-bezier(.16,.84,.44,1);
}
@media (min-width: 560px) {
  .sheet { bottom: 24px; border-radius: 28px; animation: pop .26s cubic-bezier(.16,.84,.44,1); }
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 14px; border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font-size: 1.22rem; font-weight: 800; letter-spacing: -.4px; }
.sheet-close {
  width: 34px; height: 34px; border-radius: 10px; border: none; cursor: pointer;
  background: var(--sky-50); color: var(--blue-700); font-size: 1rem; font-weight: 700;
  transition: background .15s;
}
.sheet-close:hover { background: var(--sky-100); }
.sheet-body { padding: 18px 22px 26px; overflow-y: auto; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes pop { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.section-intro { color: var(--ink-soft); font-size: .92rem; margin-bottom: 16px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 6px; }
.field label .opt { color: var(--ink-soft); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: .94rem; background: #fbfdff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue-400); box-shadow: 0 0 0 4px rgba(91,155,247,.18); background: #fff;
}
.field textarea { resize: vertical; min-height: 110px; }

.seg { display: flex; gap: 8px; }
.seg-opt {
  flex: 1; cursor: pointer; text-align: center;
  padding: 11px; border: 1px solid var(--line); border-radius: 12px;
  font-weight: 600; font-size: .9rem; background: #fbfdff; transition: all .15s;
}
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt.is-active { background: var(--grad); color: #fff; border-color: transparent; }

.btn {
  width: 100%; border: none; cursor: pointer;
  background: var(--grad); color: #fff;
  padding: 14px; border-radius: 14px; font-size: 1rem; font-weight: 700; font-family: inherit;
  box-shadow: 0 14px 30px -12px rgba(10,79,180,.6);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 18px 38px -12px rgba(10,79,180,.7); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--sky-50); color: var(--blue-700); box-shadow: none; }

/* ---------- Success ---------- */
.success { text-align: center; padding: 14px 0; }
.success .check { width: 64px; height: 64px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 1.8rem; margin: 0 auto 14px; }
.success h3 { font-size: 1.2rem; }
.success p { color: var(--ink-soft); margin: 8px 0 18px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 999px;
  font-size: .9rem; font-weight: 600; z-index: 80; opacity: 0; transition: all .3s;
  box-shadow: 0 14px 30px -10px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
