/* ═══════════════════════════════════════════════════════
   TRIAKORVO — css/base.css
   Reset, tipografia, header, navegação, layout base,
   modal e toast do app de criação.
═══════════════════════════════════════════════════════ */

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Textura de grão sobre o fundo. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── HEADER ─────────────────────────────────────────── */
.header {
  text-align: center;
  padding: 50px 20px 36px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0d0d20, var(--bg));
  position: relative;
}
.header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.header-eyebrow {
  font-family: var(--font-ui);
  font-size: .65rem;
  letter-spacing: .4em;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--gold);
  letter-spacing: .2em;
  text-shadow: 0 0 40px rgba(200, 169, 110, .3);
}
.header h2 {
  font-family: var(--font-ui);
  font-size: .85rem;
  color: var(--text-dim);
  letter-spacing: .3em;
  margin-top: 6px;
  font-weight: 400;
}

/* ── NAVEGAÇÃO ──────────────────────────────────────── */
.steps-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}
.step-tab {
  font-family: var(--font-ui);
  font-size: .6rem;
  letter-spacing: .12em;
  color: var(--text-dim);
  padding: 12px 14px;
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.step-tab:hover { color: var(--text); }
.step-tab--active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.step-tab--active .step-num {
  background: var(--gold);
  color: #000;
}
.step-num {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .55rem;
  color: var(--text-dim);
  flex-shrink: 0;
}
/* Aba "Fichas" — destaque verde. */
.step-tab--fichas { border-left: 1px solid var(--border); color: var(--green); }
.step-tab--fichas .step-num { background: var(--green-dim); color: var(--green); }

/* ── LAYOUT PRINCIPAL ───────────────────────────────── */
.main {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 16px 80px;
  position: relative;
  z-index: 1;
}
.section { display: none; }
.section--active { display: block; }

/* ── CABEÇALHO DE PASSO ─────────────────────────────── */
.step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.step-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold);
  flex-shrink: 0;
}
.step-badge--fichas { border-color: var(--green); color: var(--green); }
.step-info h3 {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: .12em;
}
.step-info p {
  font-size: .82rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 2px;
}
.section-subtitle {
  font-style: italic;
  color: var(--text-dim);
  font-size: .88rem;
  margin-bottom: 20px;
}

/* ── GRIDS GENÉRICOS ────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.grid-classes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

/* ── MODAL ──────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .8);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.modal--open { display: flex; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--red);
  padding: 28px;
  max-width: 340px;
  width: 90%;
  border-radius: var(--radius);
  text-align: center;
}
.modal-title {
  font-family: var(--font-ui);
  font-size: .8rem;
  letter-spacing: .1em;
  color: var(--red);
  margin-bottom: 8px;
}
.modal-text {
  font-size: .88rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ── TOAST ──────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  font-family: var(--font-ui);
  font-size: .7rem;
  letter-spacing: .1em;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--green);
  color: var(--green);
  z-index: 9998;
  transition: opacity .3s;
  pointer-events: none;
  white-space: nowrap;
}
.toast--hiding   { opacity: 0; }
.toast--success  { border-color: var(--green);  color: var(--green); }
.toast--danger   { border-color: var(--red);    color: var(--red); }
.toast--gold     { border-color: var(--gold);   color: var(--gold); }
.toast--info     { border-color: var(--blue);   color: var(--blue); }

/* ── UTILITÁRIOS ────────────────────────────────────── */
.empty-hint {
  color: var(--text-mute);
  font-size: .82rem;
}

/* ── MOBILE ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .steps-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .step-tab {
    padding: 10px;
    font-size: .55rem;
    white-space: nowrap;
  }
}

/* ── IMPRESSÃO ──────────────────────────────────────── */
@media print {
  body { background: #fff !important; }
  body::before,
  .steps-nav,
  .nav-buttons,
  .mode-btns,
  .pontos-bar { display: none !important; }
  .section { display: block !important; }
  .header { background: #fff !important; padding: 16px; }
  .header h1 { color: var(--gold) !important; text-shadow: none !important; }
  .card,
  .summary-section,
  .pool-section,
  .ocup-detail,
  .info-box,
  .warn-box {
    background: #f9f9f9 !important;
    border-color: #ccc !important;
    break-inside: avoid;
  }
}

/* ── Login: estado de erro no carregamento ── */
.login-loading--erro {
  color: var(--red);
  font-size: .8rem;
  line-height: 1.5;
  padding: 8px 0;
}
