@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Barlow+Condensed:wght@500;600;700&display=swap');

:root {
  --bg: #F1EAEA; --surface: #FFFFFF; --text: #2B2B2B; --muted: #6B6466;
  --red: #C8102E; --red-dark: #A30D20; --red-deep: #8E0B1C; --wine: #3A1016; --pink: #F4B6BC;
  --line: rgba(139, 10, 26, 0.10); --line-strong: rgba(58, 16, 22, 0.22);
  --soft: rgba(200, 16, 46, 0.08); --glow: rgba(200, 16, 46, 0.40);
  --warn: #7A5200; --warn-bg: #FFF1D6; --ok: #1E6B3F; --ok-bg: #E3F4EA;
  --radius: 16px;
  --title: 'Barlow Condensed', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, sans-serif; color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(rgba(200, 16, 46, 0.09) 1px, transparent 1px);
  background-size: 22px 22px;
}
a { color: var(--red); }
a:hover { color: var(--red-dark); }
h1, h2, h3 { font-family: var(--title); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; margin: 0; }
[hidden] { display: none !important; }

/* botões */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 12px; font: 700 14px Inter, sans-serif; cursor: pointer; text-decoration: none;
  transition: transform .18s, box-shadow .18s, background .18s, color .18s; border: 0; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 10px 22px -10px rgba(200,16,46,.75), inset 0 1px 0 rgba(255,255,255,.28); }
.btn-primary::after { content: ''; position: absolute; top: 0; left: -70%; width: 45%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.5), transparent); transform: skewX(-20deg); transition: left .65s; }
.btn-primary:hover:not(:disabled) { background: var(--red-dark); color: #fff; transform: translateY(-3px); box-shadow: 0 18px 32px -12px rgba(200,16,46,.85); }
.btn-primary:hover:not(:disabled)::after { left: 135%; }
.btn-ghost { background: #fff; color: var(--red-dark); border: 1.5px solid var(--red); box-shadow: 0 6px 16px -10px rgba(200,16,46,.5); }
.btn-ghost:hover:not(:disabled) { background: var(--red); color: #fff; transform: translateY(-3px); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: background .18s, color .18s; }
.icon-btn:hover { background: var(--soft); color: var(--red); }

/* cartões e formulários */
.card { background: var(--surface); border: 1px solid rgba(139,10,26,.08); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(43,43,43,.06), 0 14px 34px -20px rgba(139,10,26,.35); transition: border-color .25s, box-shadow .25s; }
.card:hover { border-color: rgba(200,16,46,.30); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.inp { height: 46px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--text);
  padding: 0 12px; font: 400 15px Inter, sans-serif; transition: border-color .2s, box-shadow .2s; width: 100%; }
.inp:hover { border-color: var(--red); }
.inp:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(200,16,46,.14); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sec-title { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.sec-title::before { content: ''; width: 6px; height: 22px; border-radius: 3px; background: var(--red); box-shadow: 0 0 12px rgba(200,16,46,.5); }
.muted { color: var(--muted); }
.pill { display: inline-flex; align-items: center; font: 700 11px Inter, sans-serif; padding: 6px 10px; border-radius: 999px; letter-spacing: .03em; white-space: nowrap; }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-red { background: #FDE2E4; color: var(--red-dark); }
.code { min-width: 40px; height: 28px; padding: 0 7px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  font: 700 11px Inter, sans-serif; letter-spacing: .03em; }

/* aviso flutuante */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 99;
  background: var(--wine); color: #fff; padding: 12px 18px; border-radius: 12px; font: 600 14px Inter, sans-serif;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.5); transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.erro { background: var(--red-dark); }

/* animação do símbolo */
@keyframes beat { 0%,100% { transform: scale(1); } 14% { transform: scale(1.14); } 28% { transform: scale(1); } 42% { transform: scale(1.08); } 70% { transform: scale(1); } }
@keyframes ecg { from { stroke-dashoffset: 2400; } to { stroke-dashoffset: 0; } }
.beat { animation: beat 1.4s ease-in-out infinite; transform-origin: 50% 60%; }
.ecg path { stroke-dasharray: 1200 1200; animation: ecg 3.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 28px; height: 28px; border-radius: 999px; border: 3px solid var(--soft); border-top-color: var(--red); animation: spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .beat, .ecg path, .spinner { animation: none; } }
