/* ConfiaVET — design tokens + base styles */

:root {
  /* Brand — Azul confiança */
  --brand: #1D3A8A;
  --brand-deep: #142A63;
  --brand-light: #4F70D8;
  --brand-glow: #A3BBF5;
  --brand-soft: #E6ECFA;
  --brand-mist: #F0F4FC;

  /* Verde saúde — acento */
  --accent: #0D8F6B;
  --accent-deep: #0A6E52;
  --accent-soft: #D7F0E3;

  /* Neutros — warm off-white */
  --bg: #FAF7F2;
  --bg-tint: #F4EEE4;
  --card: #FEFDFB;
  --card-tint: #FBF8F2;
  --border: #E8E2D4;
  --border-soft: #F0EBDF;
  --text: #1A1A1F;
  --text-soft: #4A4A55;
  --text-muted: #7D7D8A;
  --text-faint: #B8B8C4;

  /* Status */
  --warn: #C2841A;
  --warn-soft: #FBEED1;
  --warn-deep: #6E4A0E;
  --danger: #C44B3D;
  --danger-soft: #F9DFD9;

  /* Shadows — sempre com tom azulado */
  --shadow-sm: 0 1px 2px rgba(20, 42, 99, 0.04), 0 2px 6px rgba(20, 42, 99, 0.04);
  --shadow-md: 0 4px 12px rgba(20, 42, 99, 0.06), 0 12px 28px rgba(20, 42, 99, 0.08);
  --shadow-lg: 0 8px 24px rgba(20, 42, 99, 0.08), 0 24px 48px rgba(20, 42, 99, 0.12);
  --shadow-brand: 0 4px 14px rgba(29, 58, 138, 0.22), 0 1px 3px rgba(29, 58, 138, 0.15);

  /* Type */
  --serif: "Fraunces", "Cabinet Grotesk", ui-serif, Georgia, serif;
  --sans: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;

  /* Easings */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  position: relative;
}

/* Global noise overlay — quebra "limpeza estéril" */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  z-index: 9999;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
  margin: 0;
  font-variation-settings: "opsz" 144;
}

h1 { font-size: 32px; letter-spacing: -0.03em; }
h2 { font-size: 28px; letter-spacing: -0.028em; }
h3 { font-size: 20px; letter-spacing: -0.02em; }

p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-deep); text-decoration: underline; }

button { font-family: var(--sans); border: 0; cursor: pointer; background: none; }
input, textarea, select { font-family: var(--sans); }

/* (Phosphor icons rendered as CSS-masked SVGs — see Icon component) */

/* App shell ---------------------------------------------------------- */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow { max-width: 960px; }
.container--wide { max-width: 1260px; }

/* Eyebrow ------------------------------------------------------------ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-light);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1.5px;
  background: var(--brand-light);
  display: inline-block;
}
.eyebrow--dark { color: var(--brand-glow); }
.eyebrow--dark::before { background: var(--brand-glow); }

/* Buttons (B.3) ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  font-family: var(--sans);
  cursor: pointer;
  transition: transform 220ms var(--ease-out), background 220ms var(--ease-out),
              box-shadow 220ms var(--ease-out), border-color 220ms var(--ease-out),
              color 220ms var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  border: 1px solid transparent;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background: var(--brand-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(29, 58, 138, 0.32), 0 2px 4px rgba(29, 58, 138, 0.18);
  color: #fff;
  text-decoration: none;
}

.btn-light {
  background: var(--brand-light);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 112, 216, 0.32);
}
.btn-light:hover {
  background: var(--brand);
  transform: translateY(-2px);
  color: #fff;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--brand-deep);
}
.btn-ghost:hover {
  background: var(--card-tint);
  border-color: var(--brand-light);
  transform: translateY(-2px);
  color: var(--brand-deep);
  text-decoration: none;
}

.btn-on-dark {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  backdrop-filter: blur(12px);
}
.btn-on-dark:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-2px);
  color: #fff;
  text-decoration: none;
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
  text-decoration: none;
}

.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn-block { width: 100%; }

/* Cards (B.4) -------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out),
              border-color 220ms var(--ease-out);
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}
.card-tint { background: var(--card-tint); }

/* Inputs (B.5) ------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.label .req { color: var(--brand-light); margin-left: 2px; }

.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  background: var(--card-tint);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  color: var(--text);
  font-family: var(--sans);
  transition: border-color 200ms var(--ease-out),
              background 200ms var(--ease-out),
              box-shadow 200ms var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--brand-light); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(79, 112, 216, 0.15);
}
.textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%234A4A55' stroke-width='1.6' stroke-linecap='round' d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.field-row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}
.field-row-3 { grid-template-columns: repeat(3, 1fr); }
.field-row-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) {
  .field-row, .field-row-3, .field-row-4 { grid-template-columns: 1fr; }
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}
.checkbox-row input[type="checkbox"] {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-row a, .checkbox-row .lnk {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Badges (B.6) ------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--brand-soft);
  color: var(--brand);
}
.tag-success { background: var(--accent-soft); color: var(--accent-deep); }
.tag-pending { background: var(--warn-soft); color: var(--warn-deep); }
.tag-error { background: var(--danger-soft); color: var(--danger); }
.tag-neutral { background: var(--bg-tint); color: var(--text-soft); }

.tag-on-dark {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.tag-recommended {
  background: var(--accent);
  color: #fff;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.10em;
  padding: 6px 14px;
}

/* Alerts (B.7) ------------------------------------------------------- */
.alert {
  padding: 16px 18px 16px 20px;
  border-radius: 12px;
  border-left: 3px solid var(--brand);
  background: var(--brand-mist);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
.alert-warn {
  background: var(--warn-soft);
  border: 1px solid rgba(194, 132, 26, 0.22);
  border-left: 3px solid var(--warn);
  color: var(--warn-deep);
}
.alert-error {
  background: var(--danger-soft);
  border: 1px solid rgba(196, 75, 61, 0.22);
  border-left: 3px solid var(--danger);
  color: var(--danger);
  border-radius: 10px;
}
.alert strong { font-weight: 700; }

/* Icon pill ---------------------------------------------------------- */
.icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 22px;
  flex-shrink: 0;
}
.icon-pill-accent { background: var(--accent-soft); color: var(--accent-deep); }
.icon-pill-sm { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; }
.icon-pill-lg { width: 56px; height: 56px; font-size: 28px; border-radius: 14px; }

/* Skeleton ----------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, #F4EEE4 0%, #FAF7F2 50%, #F4EEE4 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: 8px;
  display: inline-block;
  height: 14px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Fade-in utility ---------------------------------------------------- */
.fade-in {
  animation: fadeIn 280ms var(--ease-out) both;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Pulsing dot -------------------------------------------------------- */
.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: pulse 1.8s var(--ease-out) infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Nav (B.1) ---------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 242, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.nav-link {
  font-size: 14.5px;
  color: var(--text-soft);
  font-weight: 500;
  cursor: pointer;
  transition: color 180ms var(--ease-out);
  text-decoration: none;
}
.nav-link:hover { color: var(--brand-deep); text-decoration: none; }
.nav-link.active { color: var(--brand); font-weight: 600; }
.nav-actions { display: flex; align-items: center; gap: 12px; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 12px;
  border-radius: 999px;
  background: var(--card-tint);
  border: 1px solid var(--border-soft);
}
.user-chip-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.user-chip-role {
  font-size: 11.5px;
  color: var(--text-muted);
}

.logout-btn {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 180ms var(--ease-out), background 180ms var(--ease-out);
}
.logout-btn:hover { color: var(--danger); background: var(--danger-soft); }

/* Footer (B.2) ------------------------------------------------------- */
.footer {
  background: var(--brand-deep);
  color: rgba(255, 255, 255, 0.78);
  padding: 64px 0 28px;
  position: relative;
  overflow: hidden;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}
.footer-tagline {
  margin-top: 18px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.7);
  max-width: 320px;
  line-height: 1.55;
}
.footer-col h4 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-glow);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  transition: color 180ms var(--ease-out);
}
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bar { flex-direction: column; gap: 8px; }
}

/* Section utilities -------------------------------------------------- */
.section { padding: 96px 0; }
.section-tint { background: var(--card-tint); }
.section-center { text-align: center; max-width: 720px; margin: 0 auto 64px; }
.section-center h2 { margin: 14px 0 14px; }
.section-center p { color: var(--text-soft); font-size: 17px; line-height: 1.55; }

/* Misc utility ------------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border-soft);
  border: 0;
  margin: 28px 0;
}
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.flex-center { display: flex; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; }
.stack-sm { gap: 8px; }
.stack-md { gap: 16px; }
.stack-lg { gap: 24px; }
.stack-xl { gap: 40px; }
.text-soft { color: var(--text-soft); }
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--brand); }
.text-accent { color: var(--accent); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* Scrollbar (cosmetic) ----------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
