/* =============================================================================
   app.css — reset, layout global, e elementos sem componente
   v3a-fix: scrollbar com paleta, inputs nunca brancos, fontes maiores
   ============================================================================= */

@import url('./theme.css');

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--font-size-md);
    line-height: var(--line-height-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app { height: 100%; }

button {
    font-family: inherit;
    font-size: inherit;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    padding: 0;
}

/* === INPUTS sólidos, nunca brancos === */
input, textarea, select {
    font-family: inherit;
    font-size: var(--font-size-base);
    color: var(--text);
    background-color: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    outline: 0;
    transition: all var(--transition);
}

input::placeholder, textarea::placeholder {
    color: var(--text-faint);
}

input:hover, textarea:hover, select:hover {
    background-color: var(--bg-elev-3);
    border-color: var(--border-strong);
}

input:focus, textarea:focus, select:focus {
    background-color: var(--bg-elev-2);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

/* Force dark background pra prevenir browser autofill virar branco */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-elev-2) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text);
}

/* === SELECT custom (chevron consistente) === */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c0c0c0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* === Checkbox custom === */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    padding: 0;
    background: var(--bg-elev-2);
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}
input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid var(--accent-on);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px var(--accent-bg);
}

a { color: var(--accent); text-decoration: none; }
img { display: block; max-width: 100%; }

/* === SPLASH === */
#splash {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    color: var(--text-muted);
    z-index: 9999;
}
#splash.hide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === SCROLLBAR (paleta) === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-elev-1);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-elev-3);
    border-radius: 5px;
    border: 2px solid var(--bg-elev-1);
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--bg-elev-4);
    background-clip: padding-box;
    border: 2px solid var(--bg-elev-1);
}
::-webkit-scrollbar-corner { background: var(--bg-elev-1); }

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-elev-3) var(--bg-elev-1);
}
