/* SCAD - Reset, body, ambient, noise, scrollbar */
/* ═══════════════════════════════════════════════════════════════
   SCAD · BASE (reset + fundo ambiente + scrollbar)
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
    font-family: var(--body);
    background: var(--bg-app);
    color: var(--txt);
    -webkit-font-smoothing: antialiased;
    transition: background .35s ease, color .35s ease;
    overflow-x: hidden;
}

/* ── Fundo ambiente em camadas ─────────────────────────────── */
.ambient {
    position: fixed; inset: -15%; z-index: 0; pointer-events: none;
    background:
        radial-gradient(40% 42% at 14% 8%,  rgba(0,132,61,.10), transparent 60%),
        radial-gradient(36% 44% at 90% 82%, rgba(0,106,49,.08), transparent 62%);
    animation: drift 30s ease-in-out infinite alternate;
}
[data-theme="dark"] .ambient {
    background:
        radial-gradient(40% 42% at 14% 8%,  rgba(0,132,61,.18), transparent 60%),
        radial-gradient(36% 44% at 90% 82%, rgba(0,106,49,.14), transparent 62%);
}
@keyframes drift {
    0%   { transform: translate3d(0,0,0) scale(1); }
    100% { transform: translate3d(-3%,2.5%,0) scale(1.09); }
}

/* Grid sutil */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(0,80,48,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,80,48,.035) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 92% 72% at 50% 0%, #000 28%, transparent 86%);
            mask-image: radial-gradient(ellipse 92% 72% at 50% 0%, #000 28%, transparent 86%);
}

/* Noise (textura de ruído) */
.noise {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    opacity: .035; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--txt3); }

/* Visual do toast vive em css/toast.css (folha canônica). */

/* ── Responsividade (mobile) ──────────────────────────────── */
@media (max-width: 900px) {
    /* Rolagem horizontal suave em iOS para tabelas, tabs, etc. */
    * { -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
    /* Evita zoom automático do iOS ao focar campos com fonte < 16px */
    input, select, textarea { font-size: 16px !important; }
}