/* SouzaFlow — componentes reutilizáveis */

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--r-md);
  border: 1px solid transparent; background: var(--c-bg-elev); color: var(--c-text);
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--c-blue); color: #fff; border-color: var(--c-blue); }
.btn--primary:hover { background: #1259dd; }
.btn--brand { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: var(--shadow-2); }
.btn--ghost { background: transparent; border-color: var(--c-border); }
.btn--danger { background: var(--c-red); color: #fff; border-color: var(--c-red); }
.btn--success { background: var(--c-green); color: #08321f; border-color: var(--c-green); }
.btn--lg { height: 52px; padding: 0 22px; font-size: 1rem; border-radius: var(--r-lg); }
.btn--xl { height: 64px; font-size: 1.1rem; border-radius: var(--r-xl); }
.btn--block { width: 100%; }
.btn--icon { width: 44px; height: 44px; padding: 0; }

.iconbtn {
  appearance: none; border: 0; background: transparent;
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: var(--r-pill);
  color: var(--c-text); position: relative;
}
.iconbtn:hover { background: var(--c-bg-sunken); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn__badge {
  position: absolute; top: 6px; right: 6px;
  background: var(--c-red); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  display: grid; place-items: center;
}

/* Form */
.form { display: grid; gap: var(--sp-4); }
.field { display: grid; gap: 6px; }
.field label { font-size: .875rem; color: var(--c-text-soft); font-weight: 600; }
.field input, .field select, .field textarea {
  appearance: none; -webkit-appearance: none;
  height: 48px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid var(--c-border); background: var(--c-bg-elev); color: var(--c-text);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; padding: 12px 14px; min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--c-blue); box-shadow: 0 0 0 4px rgba(23,107,255,.15); outline: none;
}
.check { display: flex; align-items: center; gap: 8px; color: var(--c-text-soft); font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--c-blue); }

/* Alertas */
.alert { padding: 12px 14px; border-radius: var(--r-md); font-size: .92rem; border: 1px solid transparent; }
.alert--info    { background: rgba(63,169,255,.10); border-color: rgba(63,169,255,.30); color: #0b3b66; }
.alert--success { background: rgba(52,201,139,.12); border-color: rgba(52,201,139,.35); color: #0f5b3b; }
.alert--error   { background: rgba(239,83,80,.10);  border-color: rgba(239,83,80,.35);  color: #7a1d1b; }
.alert--warning { background: rgba(245,185,66,.12); border-color: rgba(245,185,66,.4);  color: #6b4501; }

/* Cards */
.card {
  background: var(--c-bg-elev); border: 1px solid var(--c-border-soft);
  border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--shadow-1);
}
.card--brand {
  background: var(--grad-brand); color: #fff; border-color: transparent;
  box-shadow: var(--shadow-2);
}
.card--night { background: var(--grad-night); color: #fff; border-color: transparent; box-shadow: var(--shadow-2); }
.card h3 { color: inherit; }

/* Pill / chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill); font-size: .8rem; font-weight: 600;
  background: var(--c-bg-sunken); color: var(--c-text-soft);
}
.chip--success { background: rgba(52,201,139,.15); color: #0d6e44; }
.chip--warning { background: rgba(245,185,66,.18); color: #6b4501; }
.chip--danger  { background: rgba(239,83,80,.13);  color: #7a1d1b; }
.chip--brand   { background: rgba(23,107,255,.12); color: #0e3aa1; }

/* Skeleton */
.skel { background: linear-gradient(90deg, var(--c-bg-sunken) 25%, var(--c-border-soft) 50%, var(--c-bg-sunken) 75%);
        background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: var(--r-md); }
@keyframes skel { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }

/* Toast */
.toast-container { position: fixed; left: 0; right: 0; bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 12px); display: grid; place-items: center; pointer-events: none; z-index: 80; }
.toast {
  background: var(--c-text); color: #fff; padding: 12px 16px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-3); font-size: .92rem; max-width: min(540px, 92vw);
  animation: toastIn .18s ease-out;
}
.toast--success { background: var(--c-green); color: #08321f; }
.toast--error { background: var(--c-red); }
@keyframes toastIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }

/* Página de erro */
.error-page { text-align: center; max-width: 420px; }
.error-page h1 { font-size: 1.5rem; margin-top: var(--sp-4); }
.error-page p { margin-bottom: var(--sp-5); }

/* Progress bar */
.progress { height: 10px; border-radius: var(--r-pill); background: var(--c-bg-sunken); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad-brand); transition: width .4s ease; }

/* Tabela responsiva simples */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--c-border-soft); text-align: left; font-size: .92rem; }
.table th { color: var(--c-text-mute); font-weight: 600; }

/* Visualmente oculto */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
