/**
 * mil776 — Design System
 * Fonte única de verdade para todos os tokens visuais.
 * Importe este arquivo em todas as telas antes de qualquer outro CSS.
 *
 * Uso: <link rel="stylesheet" href="/assets/css/design-system.css">
 */

/* ═══════════════════════════════════════════════════════════
   1. TOKENS — VARIÁVEIS GLOBAIS
   ═══════════════════════════════════════════════════════════ */

:root {

  /* ── Cores principais ──────────────────────────────────── */
  --cream:          #FBF7F0;   /* fundo geral */
  --terra:          #C4651A;   /* acento primário — terracota âmbar */
  --brown:          #3D2F1E;   /* texto e card de resultado */
  --muted:          #8A7055;   /* texto secundário */
  --hint:           #B09070;   /* placeholders, labels, captions */
  --border:         #E8DCC8;   /* bordas gerais */
  --surface:        #FFFFFF;   /* superfícies de cards */
  --gold:           #F5C57A;   /* número no card de resultado */

  /* ── Cores semânticas ──────────────────────────────────── */
  --success:        #3B6D11;
  --success-bg:     #EAF3DE;
  --success-border: #C8DDB0;
  --success-text:   #2A4A0F;

  --warn:           #C4651A;
  --warn-bg:        #FFF3E0;
  --warn-border:    #E8C99A;
  --warn-text:      #7A5030;

  --error:          #A32D2D;
  --error-bg:       #FDF4F0;
  --error-border:   #F0C0B0;
  --error-text:     #993C1D;

  /* ── Tipografia ────────────────────────────────────────── */
  --font-sans:   -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif:  Georgia, 'Times New Roman', serif;
  --font-mono:   'SF Mono', 'Fira Code', monospace;

  --text-display:   32px;  /* números de impacto */
  --text-heading:   20px;
  --text-subhead:   16px;
  --text-body:      14px;
  --text-caption:   12px;
  --text-label:     10px;

  --weight-regular: 400;
  --weight-bold:    600;
  --weight-black:   700;

  --leading-tight:  1.2;
  --leading-normal: 1.5;
  --leading-loose:  1.7;

  /* ── Espaçamento ───────────────────────────────────────── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;

  /* ── Border radius ─────────────────────────────────────── */
  --r-xs:  6px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 24px;
  --r-full: 9999px;

  /* ── Bordas ────────────────────────────────────────────── */
  --border-width:       1px;
  --border-width-thick: 1.5px;
  --border-default:     1px solid var(--border);
  --border-thick:       1.5px solid var(--border);
  --border-terra:       1.5px solid var(--terra);
  --border-success:     1px solid var(--success-border);
  --border-error:       1.5px solid var(--error-border);

  /* ── Transições ────────────────────────────────────────── */
  --transition-fast:   .15s ease;
  --transition-normal: .2s ease;
  --transition-slow:   .3s ease;

  /* ── Layout ────────────────────────────────────────────── */
  --max-width:     480px;  /* largura máxima do app */
  --topbar-height: 56px;
  --nav-height:    64px;
  --page-padding:  16px;
}


/* ═══════════════════════════════════════════════════════════
   2. RESET & BASE
   ═══════════════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--brown);
  background: var(--cream);
  line-height: var(--leading-normal);
  min-height: 100vh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }


/* ═══════════════════════════════════════════════════════════
   3. LAYOUT
   ═══════════════════════════════════════════════════════════ */

/* Container principal do app */
.app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--cream);
}

/* Área de conteúdo com scroll (entre topbar e nav) */
.page {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--page-padding);
  padding-bottom: calc(var(--nav-height) + var(--space-4));
}

/* Página sem nav inferior */
.page--full {
  padding-bottom: var(--page-padding);
}

/* Stack vertical padrão */
.stack { display: flex; flex-direction: column; }
.stack--2  { gap: var(--space-2); }
.stack--3  { gap: var(--space-3); }
.stack--4  { gap: var(--space-4); }
.stack--5  { gap: var(--space-5); }
.stack--6  { gap: var(--space-6); }

/* Grid de 2 colunas */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}


/* ═══════════════════════════════════════════════════════════
   4. TIPOGRAFIA
   ═══════════════════════════════════════════════════════════ */

.text-display {
  font-size: var(--text-display);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  color: var(--brown);
}

.text-heading {
  font-size: var(--text-heading);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  color: var(--brown);
}

.text-subhead {
  font-size: var(--text-subhead);
  font-weight: var(--weight-bold);
  color: var(--brown);
}

.text-body  { font-size: var(--text-body); color: var(--brown); }
.text-caption { font-size: var(--text-caption); color: var(--muted); }
.text-label {
  font-size: var(--text-label);
  font-weight: var(--weight-bold);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--hint);
}

/* Modificadores de cor */
.text-terra   { color: var(--terra); }
.text-muted   { color: var(--muted); }
.text-hint    { color: var(--hint); }
.text-gold    { color: var(--gold); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.text-cream   { color: var(--cream); }

/* Modificadores de peso */
.font-regular { font-weight: var(--weight-regular); }
.font-bold    { font-weight: var(--weight-bold); }
.font-black   { font-weight: var(--weight-black); }

/* Alinhamento */
.text-center { text-align: center; }
.text-right  { text-align: right; }


/* ═══════════════════════════════════════════════════════════
   5. TOPBAR
   ═══════════════════════════════════════════════════════════ */

.topbar {
  height: var(--topbar-height);
  background: var(--cream);
  padding: 0 var(--page-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--border-default);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__logo {
  font-size: 20px;
  font-weight: var(--weight-black);
  color: var(--brown);
  letter-spacing: -0.5px;
}

.topbar__logo span { color: var(--terra); }

.topbar__title {
  font-size: var(--text-subhead);
  font-weight: var(--weight-bold);
  color: var(--brown);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Botão de voltar */
.btn-back {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: #F0E6D3;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.btn-back:hover { opacity: 0.8; }

/* Avatar do usuário */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: #F0E6D3;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: var(--weight-bold);
  color: var(--terra);
  cursor: pointer;
}


/* ═══════════════════════════════════════════════════════════
   6. BOTTOM NAV
   ═══════════════════════════════════════════════════════════ */

.bottom-nav {
  height: var(--nav-height);
  background: var(--surface);
  border-top: var(--border-default);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: var(--text-label);
  color: var(--hint);
  cursor: pointer;
  transition: color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.nav-item:hover,
.nav-item--active { color: var(--terra); }

/* FAB central */
.nav-fab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: var(--space-2);
  gap: 3px;
  font-size: var(--text-label);
  color: var(--terra);
  cursor: pointer;
}

.fab {
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  background: var(--terra);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -20px;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.fab:active { transform: scale(0.95); opacity: 0.9; }


/* ═══════════════════════════════════════════════════════════
   7. BOTÕES
   ═══════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 48px;
  padding: 0 var(--space-5);
  border-radius: var(--r-md);
  font-size: var(--text-body);
  font-weight: var(--weight-bold);
  font-family: var(--font-sans);
  border: none;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

/* Variantes */
.btn--primary {
  background: var(--terra);
  color: var(--cream);
}
.btn--primary:hover { opacity: 0.9; }

.btn--secondary {
  background: var(--surface);
  color: var(--terra);
  border: var(--border-terra);
}
.btn--secondary:hover { background: var(--warn-bg); }

.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: var(--border-default);
}
.btn--ghost:hover { background: var(--surface); }

.btn--success {
  background: var(--success);
  color: var(--cream);
}
.btn--success:hover { opacity: 0.9; }

.btn--danger {
  background: var(--error-bg);
  color: var(--error);
  border: var(--border-error);
}

/* Tamanhos */
.btn--sm   { height: 36px; padding: 0 var(--space-4); font-size: var(--text-caption); border-radius: var(--r-sm); }
.btn--lg   { height: 56px; padding: 0 var(--space-8); font-size: var(--text-subhead); border-radius: var(--r-lg); }
.btn--full { width: 100%; }
.btn--icon { width: 44px; height: 44px; padding: 0; border-radius: var(--r-md); }
.btn--icon-sm { width: 32px; height: 32px; padding: 0; border-radius: var(--r-sm); }
.btn--circle { border-radius: var(--r-full); }

/* Estado desabilitado */
.btn:disabled,
.btn--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════
   8. INPUTS E FORMULÁRIOS
   ═══════════════════════════════════════════════════════════ */

.field { display: flex; flex-direction: column; gap: var(--space-1); }

.field__label {
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  color: #5A3F25;
}

.field__hint {
  font-size: 11px;
  color: var(--hint);
  line-height: var(--leading-normal);
}

.field__error {
  font-size: 11px;
  color: var(--error);
}

.field__success {
  font-size: 11px;
  color: var(--success);
}

/* Input base */
.input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4);
  border: var(--border-thick);
  border-radius: var(--r-md);
  font-size: var(--text-body);
  font-family: var(--font-sans);
  color: var(--brown);
  background: #FDFAF5;
  outline: none;
  transition: border-color var(--transition-normal), background var(--transition-normal);
  -webkit-appearance: none;
}

.input:focus {
  border-color: var(--terra);
  background: var(--surface);
}

.input::placeholder { color: var(--hint); }

/* Estados do input */
.input--error   { border-color: var(--error); background: var(--error-bg); }
.input--success { border-color: var(--success); }
.input--sm      { height: 36px; font-size: var(--text-caption); border-radius: var(--r-sm); }

/* Select */
.select {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4);
  border: var(--border-thick);
  border-radius: var(--r-md);
  font-size: var(--text-body);
  font-family: var(--font-sans);
  color: var(--brown);
  background: #FDFAF5;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%238A7055' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.select:focus { border-color: var(--terra); background-color: var(--surface); }

/* Radio e Checkbox */
.radio-group,
.check-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.radio-item,
.check-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-body);
  color: var(--brown);
  cursor: pointer;
  padding: var(--space-2) 0;
}

.radio-dot {
  width: 20px;
  height: 20px;
  border-radius: var(--r-full);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition-fast);
}

.radio-dot--active {
  border-color: var(--terra);
  background: var(--terra);
}

.radio-dot--active::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  background: var(--cream);
}

/* Toggle */
.toggle {
  width: 46px;
  height: 28px;
  border-radius: 14px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background var(--transition-normal);
  flex-shrink: 0;
}

.toggle--on { background: var(--terra); }

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: var(--r-full);
  background: var(--surface);
  transition: transform var(--transition-normal);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle--on::after { transform: translateX(18px); }

/* Divider com label */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--hint);
  font-size: var(--text-caption);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* ═══════════════════════════════════════════════════════════
   9. CARDS
   ═══════════════════════════════════════════════════════════ */

/* Card base padrão */
.card {
  background: var(--surface);
  border: var(--border-default);
  border-radius: var(--r-xl);
  padding: var(--space-4);
}

.card--sm { padding: var(--space-3); border-radius: var(--r-lg); }
.card--lg { padding: var(--space-5); }

/* Card hero — fundo terracota */
.card-hero {
  background: var(--terra);
  border-radius: var(--r-xl);
  padding: var(--space-5);
  color: var(--cream);
}

.card-hero__label {
  font-size: var(--text-label);
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: var(--space-1);
}

.card-hero__value {
  font-size: 44px;
  font-weight: var(--weight-black);
  line-height: 1;
}

.card-hero__sub {
  font-size: var(--text-caption);
  opacity: 0.85;
  margin-top: var(--space-1);
}

.card-hero__badge {
  background: rgba(255,255,255,0.2);
  border-radius: var(--r-full);
  padding: 4px 12px;
  font-size: 11px;
  display: inline-block;
}

/* Card resultado — fundo marrom escuro */
.card-result {
  background: var(--brown);
  border-radius: var(--r-xl);
  padding: var(--space-5);
  text-align: center;
}

.card-result__label {
  font-size: var(--text-label);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #C4A882;
  margin-bottom: var(--space-1);
}

.card-result__value {
  font-size: 52px;
  font-weight: var(--weight-black);
  color: var(--gold);
  line-height: 1;
}

.card-result__unit {
  font-size: var(--text-subhead);
  color: #C4A882;
  margin-top: var(--space-1);
}

.card-result__equiv {
  font-size: var(--text-caption);
  color: #A08060;
  margin-top: var(--space-3);
  line-height: var(--leading-loose);
}

.card-result__equiv strong { color: var(--gold); }

/* Card sucesso — fundo verde claro */
.card-success {
  background: var(--success-bg);
  border: var(--border-success);
  border-radius: var(--r-xl);
  padding: var(--space-4);
}

/* Card atenção — fundo âmbar */
.card-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--r-xl);
  padding: var(--space-4);
}

/* Card erro */
.card-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--r-xl);
  padding: var(--space-4);
}

/* Item card — usado no histórico e dashboard */
.item-card {
  background: var(--surface);
  border: var(--border-default);
  border-radius: var(--r-lg);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: border-color var(--transition-fast);
}

.item-card:active { border-color: var(--terra); }

.item-card--success {
  background: var(--success-bg);
  border-color: var(--success-border);
}

.item-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--warn-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.item-card--success .item-card__icon { background: var(--success-bg); }

.item-card__info { flex: 1; min-width: 0; }

.item-card__name {
  font-size: var(--text-body);
  font-weight: var(--weight-bold);
  color: var(--brown);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-card--success .item-card__name { color: var(--success-text); }

.item-card__sub {
  font-size: var(--text-caption);
  color: var(--muted);
  margin-top: 2px;
}

.item-card__hours {
  font-size: var(--text-body);
  font-weight: var(--weight-black);
  color: var(--terra);
  text-align: right;
  white-space: nowrap;
}

.item-card--success .item-card__hours { color: var(--success); }

.item-card__hours-label {
  font-size: 10px;
  color: var(--hint);
  text-align: right;
}

.item-card--success .item-card__hours-label { color: #639922; }


/* ═══════════════════════════════════════════════════════════
   10. BADGES E PILLS
   ═══════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: var(--weight-bold);
  white-space: nowrap;
}

.badge--terra   { background: var(--warn-bg); color: var(--terra); border: 1px solid var(--warn-border); }
.badge--success { background: var(--success-bg); color: var(--success); border: var(--border-success); }
.badge--muted   { background: #F0E8DC; color: var(--muted); border: var(--border-default); }
.badge--dark    { background: rgba(61,47,30,.1); color: var(--brown); border: 1px solid rgba(61,47,30,.15); }
.badge--error   { background: var(--error-bg); color: var(--error); border: 1px solid var(--error-border); }

/* Pill — mais largo, com ícone */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface);
  border: var(--border-default);
  border-radius: var(--r-full);
  padding: 7px 14px;
  font-size: var(--text-caption);
  color: #5A3F25;
  line-height: var(--leading-normal);
}


/* ═══════════════════════════════════════════════════════════
   11. ÍCONE — CONTAINER
   ═══════════════════════════════════════════════════════════ */

.icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--warn-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-box--lg  { width: 56px; height: 56px; border-radius: var(--r-lg); }
.icon-box--sm  { width: 32px; height: 32px; border-radius: var(--r-sm); }
.icon-box--success { background: var(--success-bg); }
.icon-box--brown   { background: rgba(61,47,30,.08); }
.icon-box--circle  { border-radius: var(--r-full); }


/* ═══════════════════════════════════════════════════════════
   12. PROGRESS BAR
   ═══════════════════════════════════════════════════════════ */

.progress {
  height: 6px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress--lg { height: 10px; }

.progress__fill {
  height: 100%;
  background: var(--terra);
  border-radius: var(--r-full);
  transition: width var(--transition-slow);
}

.progress__fill--success { background: var(--success); }


/* ═══════════════════════════════════════════════════════════
   13. SKELETON (loading)
   ═══════════════════════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(90deg, #EDE8DF 25%, #E4DDD4 50%, #EDE8DF 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--r-xs);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ═══════════════════════════════════════════════════════════
   14. BOTTOM SHEET / MODAL
   ═══════════════════════════════════════════════════════════ */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(61,47,30,.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  animation: overlay-in var(--transition-normal);
}

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.sheet {
  background: var(--surface);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: var(--space-5);
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  animation: sheet-in var(--transition-normal);
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.sheet__handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: var(--r-full);
  margin: 0 auto var(--space-5);
}


/* ═══════════════════════════════════════════════════════════
   15. STEP INDICATOR (onboarding)
   ═══════════════════════════════════════════════════════════ */

.steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.step {
  display: flex;
  align-items: center;
  flex: 1;
}

.step__dot {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  border: 2px solid var(--border);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  color: var(--hint);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: all var(--transition-normal);
}

.step--active .step__dot  { border-color: var(--terra); background: var(--terra); color: var(--cream); }
.step--done .step__dot    { border-color: var(--terra); background: var(--terra); color: var(--cream); }

.step__line {
  flex: 1;
  height: 2px;
  background: var(--border);
  transition: background var(--transition-normal);
}

.step--done .step__line { background: var(--terra); }


/* ═══════════════════════════════════════════════════════════
   16. SPLASH / LOADING
   ═══════════════════════════════════════════════════════════ */

.splash {
  position: fixed;
  inset: 0;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity var(--transition-slow);
}

.splash__logo {
  font-size: 40px;
  font-weight: var(--weight-black);
  color: var(--brown);
  letter-spacing: -1px;
}

.splash__logo span { color: var(--terra); }

.splash__tagline {
  font-size: var(--text-caption);
  color: var(--muted);
  margin-top: var(--space-2);
}

.splash--hidden { opacity: 0; pointer-events: none; }


/* ═══════════════════════════════════════════════════════════
   17. UTILITÁRIOS
   ═══════════════════════════════════════════════════════════ */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.hidden   { display: none !important; }
.visible  { display: block !important; }

.mt-auto  { margin-top: auto; }
.mb-0     { margin-bottom: 0; }
.w-full   { width: 100%; }
.h-full   { height: 100%; }

.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-2    { gap: var(--space-2); }
.gap-3    { gap: var(--space-3); }
.gap-4    { gap: var(--space-4); }

.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }

.rounded-full { border-radius: var(--r-full); }
.rounded-lg   { border-radius: var(--r-lg); }
.rounded-xl   { border-radius: var(--r-xl); }

.border       { border: var(--border-default); }
.border-terra { border: var(--border-terra); }

.bg-cream   { background: var(--cream); }
.bg-surface { background: var(--surface); }
.bg-terra   { background: var(--terra); }
.bg-brown   { background: var(--brown); }

.opacity-50 { opacity: 0.5; }
.pointer    { cursor: pointer; }
.no-select  { user-select: none; -webkit-user-select: none; }

/* Divisor horizontal simples */
.hr {
  border: none;
  border-top: var(--border-default);
  margin: var(--space-4) 0;
}

/* Scroll suave sem scrollbar visível */
.scroll-y {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll-y::-webkit-scrollbar { display: none; }


/* ═══════════════════════════════════════════════════════════
   18. ANIMAÇÕES
   ═══════════════════════════════════════════════════════════ */

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes celebrate {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.15); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.animate-in     { animation: fade-in .25s ease forwards; }
.animate-scale  { animation: scale-in .2s ease forwards; }
.animate-celebrate { animation: celebrate .4s ease forwards; }


/* ═══════════════════════════════════════════════════════════
   19. RESPONSIVIDADE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 360px) {
  :root {
    --page-padding: 12px;
    --text-display: 28px;
  }
}

@media (min-width: 480px) {
  .app {
    border-left:  var(--border-default);
    border-right: var(--border-default);
    min-height: 100vh;
  }
}
