/* ============================================================
   Vittalit Digital — portal do paciente e painel administrativo
   ============================================================ */

@font-face {
  font-family: 'Jakarta';
  src: url('../fonts/jakarta.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --blue: #00AEEF;
  --blue-deep: #0284c7;
  --cyan: #4fd6ff;
  --navy: #07203f;
  --ink: #10243c;
  --muted: #5b7186;
  --bg: #f4f9fd;
  --line: rgba(7, 32, 63, 0.09);
  --shadow-sm: 0 2px 10px rgba(7, 32, 63, 0.06);
  --shadow-md: 0 14px 40px -12px rgba(7, 32, 63, 0.18);
  --shadow-blue: 0 12px 30px -10px rgba(0, 174, 239, 0.45);
  --grad: linear-gradient(120deg, #00aeef, #38c6ff 55%, #7ee0ff);
  --ok: #16a34a;
  --err: #dc2626;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Jakarta', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.55;
  -webkit-font-smoothing: antialiased; min-height: 100svh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font: inherit; color: var(--ink); }

.hidden { display: none !important; }

/* ---------- tela de login ---------- */
.auth-screen {
  min-height: 100svh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 600px at 90% -10%, rgba(0,174,239,.18), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(0,174,239,.14), transparent 55%),
    linear-gradient(180deg, #eef7fd, #f4f9fd);
}
.auth-card {
  width: min(420px, 100%); background: #fff; border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--shadow-md); padding: 38px 34px;
  animation: rise .6s cubic-bezier(.2,.65,.25,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
.auth-card .logo { width: 130px; margin: 0 auto 8px; }
.auth-card h1 { text-align: center; font-size: 1.3rem; color: var(--navy); font-weight: 800; letter-spacing: -.01em; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: .9rem; margin: 6px 0 26px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 15px; background: var(--bg); outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(0,174,239,.13);
}
.field textarea { min-height: 200px; resize: vertical; line-height: 1.6; }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; border-radius: 12px; padding: 13px 22px; font-size: .96rem;
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-blue); width: 100%; }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn-soft { background: rgba(0,174,239,.12); color: var(--blue-deep); }
.btn-soft:hover { background: rgba(0,174,239,.2); }
.btn-danger { background: rgba(220,38,38,.1); color: var(--err); }
.btn-danger:hover { background: rgba(220,38,38,.18); }
.btn-sm { padding: 8px 14px; font-size: .84rem; border-radius: 10px; }

.msg { border-radius: 12px; padding: 12px 15px; font-size: .88rem; font-weight: 600; margin-bottom: 16px; display: none; }
.msg.show { display: block; animation: rise .35s; }
.msg.err { background: rgba(220,38,38,.09); color: var(--err); }
.msg.ok { background: rgba(22,163,74,.1); color: var(--ok); }

/* ---------- app shell ---------- */
.app { min-height: 100svh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  width: min(1080px, calc(100% - 40px)); margin-inline: auto;
  display: flex; align-items: center; gap: 14px; padding: 13px 0;
}
.topbar img { height: 36px; }
.topbar .who { margin-left: auto; text-align: right; }
.topbar .who b { display: block; font-size: .9rem; color: var(--navy); line-height: 1.2; }
.topbar .who small { font-size: .74rem; color: var(--muted); }
.topbar .out { color: var(--muted); font-size: .82rem; font-weight: 700; padding: 8px 12px; border-radius: 10px; }
.topbar .out:hover { background: rgba(220,38,38,.08); color: var(--err); }

.main { width: min(1080px, calc(100% - 40px)); margin: 28px auto 60px; flex: 1; }

.pagehead { margin-bottom: 22px; }
.pagehead h2 { font-size: 1.5rem; font-weight: 800; color: var(--navy); letter-spacing: -.01em; }
.pagehead p { color: var(--muted); font-size: .92rem; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tab {
  padding: 10px 19px; border-radius: 999px; font-weight: 700; font-size: .9rem;
  background: #fff; color: var(--muted); border: 1.5px solid var(--line); transition: all .25s;
}
.tab:hover { color: var(--blue-deep); border-color: rgba(0,174,239,.4); }
.tab.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--shadow-blue); }
.panel { display: none; }
.panel.active { display: block; animation: rise .4s; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-sm); padding: 24px; margin-bottom: 18px;
}
.card h3 { font-size: 1.05rem; font-weight: 800; color: var(--navy); margin-bottom: 14px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }

/* itens de lista (exames, pacientes) */
.item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px; transition: border-color .25s, transform .2s;
}
.item:hover { border-color: rgba(0,174,239,.4); }
.item.click { cursor: pointer; }
.item.click:hover { transform: translateX(3px); }
.item .ic {
  width: 42px; height: 42px; flex: none; border-radius: 12px;
  background: rgba(0,174,239,.13); color: var(--blue-deep); display: grid; place-items: center;
}
.item .tx { min-width: 0; flex: 1; }
.item .tx b { display: block; font-size: .94rem; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .tx small { font-size: .78rem; color: var(--muted); }
.item .actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: .68rem; font-weight: 800; padding: 5px 11px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; flex: none; }
.badge.blue { color: var(--blue-deep); background: rgba(0,174,239,.13); }
.badge.green { color: var(--ok); background: rgba(22,163,74,.11); }
.badge.gray { color: var(--muted); background: rgba(91,113,134,.12); }

.empty { text-align: center; color: var(--muted); padding: 38px 16px; font-weight: 600; font-size: .92rem; }
.empty svg { margin: 0 auto 10px; opacity: .5; }

/* ---------- gestação (linha do tempo) ---------- */
.preg-hero {
  background: linear-gradient(120deg, var(--navy), #0e3a6b);
  border-radius: 18px; color: #fff; padding: 26px; margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.preg-hero::after {
  content: ""; position: absolute; top: -70%; right: -5%; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(0,174,239,.5), transparent 70%);
}
.preg-hero b { font-size: 1.6rem; }
.preg-hero p { color: #bfe6fb; font-size: .9rem; position: relative; }
.preg-bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.18); margin-top: 16px; overflow: hidden; position: relative; }
.preg-bar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width 1s cubic-bezier(.2,.65,.25,1); }
.preg-meta { display: flex; justify-content: space-between; font-size: .76rem; color: #bfe6fb; margin-top: 7px; position: relative; }

.tl { position: relative; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: rgba(0,174,239,.3); }
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 16px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0,174,239,.35);
}

/* ---------- markdown simples do plano alimentar ---------- */
.plan-view h4 { color: var(--navy); font-size: 1.02rem; margin: 18px 0 8px; }
.plan-view p { margin-bottom: 10px; font-size: .94rem; }
.plan-view ul { margin: 0 0 12px 20px; font-size: .94rem; }
.plan-view li { margin-bottom: 4px; }
.plan-view strong { color: var(--navy); }

/* ---------- modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(7,32,63,.5); backdrop-filter: blur(4px);
  display: none; place-items: center; z-index: 90; padding: 20px;
}
.modal-bg.show { display: grid; animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: 88svh; overflow: auto;
  background: #fff; border-radius: 20px; padding: 28px; box-shadow: var(--shadow-md);
  animation: rise .35s;
}
.modal h3 { font-size: 1.15rem; font-weight: 800; color: var(--navy); margin-bottom: 18px; }
.modal .x { float: right; color: var(--muted); font-size: 1.1rem; padding: 4px 10px; border-radius: 8px; }
.modal .x:hover { background: var(--bg); }

.toolrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolrow .search { flex: 1 1 240px; display: flex; align-items: center; gap: 9px; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 16px; }
.toolrow .search input { border: none; outline: none; background: none; width: 100%; }
.toolrow .search svg { color: var(--muted); flex: none; }

@media (max-width: 640px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .item { flex-wrap: wrap; }
  .item .actions { width: 100%; justify-content: flex-start; }
  .topbar .who small { display: none; }
}
