/* ═══════════════════════════════════════════════════════════
   base.css — Reset, tipografia, estilos de base
═══════════════════════════════════════════════════════════ */

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.65;
  transition: background var(--transition), color var(--transition);
}

/* ── TIPOGRAFIA ── */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-title {
  font-size: clamp(22px, 3vw, 30px);
  margin-bottom: var(--space-2);
}

.section-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  max-width: 600px;
  line-height: 1.6;
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── SELEÇÃO ── */
::selection {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ── FOCO ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── TRANSIÇÃO DE TEMA ── */
body, .app-header, .card, .nav-tab, input, textarea, select, button {
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}

/* ── RANGE INPUT ── */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-overlay);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
input[type=range]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
}

/* ── COLOR INPUT ── */
input[type=color] {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm);
}
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; border-radius: var(--radius-sm); }
input[type=color]::-webkit-color-swatch { border: none; border-radius: var(--radius-sm); }

/* ── TEXTAREA ── */
textarea {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
  outline: none;
  line-height: 1.6;
}
textarea::placeholder { color: var(--text-muted); }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

/* ── ANIMAÇÃO ENTRADA ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.25s ease both; }

/* ── FOTO ANIMAÇÕES ── */
@keyframes flash-danger  { 0%,100%{background:#1a0000} 50%{background:#ff1a1a} }
@keyframes flash-safe    { 0%,100%{background:#001a18} 50%{background:#007060} }
@keyframes pulse-slow    { 0%,100%{opacity:1}          50%{opacity:0.35} }
@keyframes stripes-move  { 0%{background-position:0 0} 100%{background-position:20px 0} }

.demo-flash-danger  { animation: flash-danger  0.33s infinite; }
.demo-flash-safe    { animation: flash-safe    2s   infinite; }
.demo-pulse-ok      { animation: pulse-slow    2.4s infinite ease-in-out; }
.demo-stripes-move  {
  background: repeating-linear-gradient(90deg,#111 0,#111 10px,#eee 10px,#eee 20px);
  animation: stripes-move 0.28s linear infinite;
}
.demo-stripes-static {
  background: repeating-linear-gradient(135deg, var(--bg-raised) 0, var(--bg-raised) 20px, var(--bg-overlay) 20px, var(--bg-overlay) 40px);
}
