/* =================================================================
   GLOBAL.CSS - Variáveis e Componentes Base do Sistema
   ================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }

:root {
    --bg-light: #F5F5F7;
    --text-light: #0F172A;
    --card-light: rgba(255, 255, 255, 0.8);
    --border-light: rgba(0,0,0,0.05);
    
    --bg-dark: #0B0E14;
    --text-dark: #F1F5F9;
    --card-dark: #151921;
    --input-dark: #101218;
    --border-dark: #252937;
    
    --accent-pink: #FF2E93;
    --accent-orange: #FF8A50;
    --accent-dark-pink: #C41466;
    
    --success: #10B981;
    --error: #EF4444;
}

/* Base Limpa para o Body (Sem forçar flexbox) */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-light);
    /*transition: background-color 0.3s ease, color 0.3s ease;*/
    -webkit-font-smoothing: antialiased;
}

html.dark body { background-color: var(--bg-dark); color: var(--text-dark); }

.hidden { display: none !important; }

/* --- FORMS & INPUTS --- */

.form-group { margin-bottom: 24px; }

.form-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; color: #64748b; }
html.dark .form-label { color: #94A3B8; }

.input-wrapper { position: relative; }

.input-icon { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; color: #94A3B8; pointer-events: none; }

.input-pro { width: 100%; height: 48px; border-radius: 8px; font-size: 15px; padding: 0 16px 0 44px; transition: border-color 0.0s, box-shadow 0.0s; background-color: #FFFFFF; border: 1px solid #E2E8F0; color: #0F172A; }

.input-pro:focus { border-color: var(--accent-pink); box-shadow: 0 0 0 3px rgba(255, 46, 147, 0.1); }

html.dark .input-pro { background-color: var(--input-dark); border: 1px solid #252937; color: #fff; }
html.dark .input-pro:focus { border-color: var(--accent-pink); background-color: var(--bg-dark); box-shadow: 0 0 0 1px rgba(255, 46, 147, 0.2); }

/* --- BUTTONS --- */
.btn-primary { width: 100%; height: 48px; border: none; border-radius: 12px; background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-orange) 100%); color: white; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 4px 15px rgba(255, 46, 147, 0.3); display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s ease; }
.btn-primary:hover { opacity: 0.9; box-shadow: 0 6px 20px rgba(255, 46, 147, 0.4); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-link { background: none; border: none; color: var(--accent-pink); font-weight: 600; cursor: pointer; font-size: 12px; transition: opacity 0.2s; }
.btn-link:hover { opacity: 0.8; }
.btn-back { display: flex; align-items: center; gap: 4px; font-size: 12px; text-transform: uppercase; font-weight: 700; color: #94A3B8; cursor: pointer; background: none; border: none; margin-bottom: 24px; }
.btn-back:hover { color: var(--text-light); }
html.dark .btn-back:hover { color: var(--text-dark); }

/* --- THEME TOGGLE --- */
.theme-toggle { 
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 6px;
    background: none; 
    border: none; 
    color: #94A3B8; 
    cursor: pointer; 
    border-radius: 50%; 
    transition: all 0.2s; 
}
.theme-toggle:hover { background: rgba(0,0,0,0.05); }
html.dark .theme-toggle:hover { background: rgba(255,255,255,0.05); }

/* --- LOADERS & TOASTS --- */
.spinner { border: 2px solid rgba(255,255,255,0.2); border-left-color: #ffffff; border-radius: 50%; width: 18px; height: 18px; animation: spin 1s linear infinite; }
#full-screen-loader { position: fixed; inset: 0; background: var(--bg-light); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.5s ease; }
html.dark #full-screen-loader { background: var(--bg-dark); }
.loader-circle { width: 64px; height: 64px; position: relative; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.loader-ring { position: absolute; inset: 0; border: 4px solid rgba(0,0,0,0.1); border-top-color: var(--accent-pink); border-radius: 50%; animation: spin 1s linear infinite; }
html.dark .loader-ring { border-color: rgba(255,255,255,0.1); border-top-color: var(--accent-pink); }
.loader-icon { color: var(--accent-pink); z-index: 10; width: 24px; height: 24px; fill: rgba(255, 46, 147, 0.2); }
.loader-text { font-size: 14px; font-weight: 500; color: #64748b; animation: pulse 1.5s infinite; }

.toast-container { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 384px; pointer-events: none; }
.toast-item { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; background: white; border: 1px solid #E2E8F0; box-shadow: 0 10px 25px rgba(0,0,0,0.1); font-size: 14px; font-weight: 500; backdrop-filter: blur(8px); }
html.dark .toast-item { background: var(--card-dark); border-color: var(--border-dark); color: white; }
.toast-success svg { color: var(--success); }
.toast-error svg { color: var(--error); }

/* --- ANIMATIONS --- */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fadeIn { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { 0% { transform: translateX(100%); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { 0% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(100%); opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.fade-exit { opacity: 0; pointer-events: none; }


/* =========================================================================
   PADRÃO GLOBAL DE BARRA DE ROLAGEM (SCROLLBAR)
   ========================================================================= */

/* 1. Regra para o Firefox (Usa uma sintaxe diferente dos outros navegadores) */
* {
    scrollbar-width: thin; /* Deixa a barra mais fina */
    scrollbar-color: rgba(100, 116, 139, 0.4) transparent; /* Cor da barra e cor do fundo */
}

/* 2. Regras para Chrome, Edge, Safari e Opera (Webkit) */
::-webkit-scrollbar {
    width: 8px;  /* Largura da barra vertical */
    height: 8px; /* Altura da barra horizontal (se existir) */
}

/* Fundo da barra de rolagem (a "trilha" por onde ela corre) */
::-webkit-scrollbar-track {
    background: transparent; /* Fundo invisível para ficar mais clean */
}

/* A barrinha em si (o "polegar" que você arrasta) */
::-webkit-scrollbar-thumb {
    background-color: rgba(100, 116, 139, 0.4); /* Cor neutra baseada no seu design (#64748b) */
    border-radius: 10px; /* Deixa as pontas da barra arredondadas */
    border: 2px solid transparent; /* Cria um espaço (padding) invisível em volta da barra */
    background-clip: padding-box; /* Faz a cor respeitar o espaço da borda que criamos acima */
}

/* Efeito ao passar o mouse por cima da barrinha */
::-webkit-scrollbar-thumb:hover {
    background-color: rgba(100, 116, 139, 0.7); /* Fica mais escura/visível no hover */
}

/* =========================================================================
   ADAPTAÇÃO DA BARRA PARA O MODO ESCURO (DARK MODE)
   ========================================================================= */
html.dark * {
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

html.dark ::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.3); /* Cor mais clara para contrastar no fundo escuro */
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(148, 163, 184, 0.6);
}