:root { --blue: #2982C4; --green: #2FCC71; --muted: #6b7280; }
* {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body { background: #f5f7fb;
    margin: 0;
    padding: 0;
    background: #f5f7fb;
    color: #333;
}

/* Logo/Brand style */
.logo-brand {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    gap: 10px !important;
    text-decoration: none !important;
    width: auto !important;
}

.logo-brand img {
    width: 28px !important;
    height: 28px !important;
    display: block !important;
    margin: 0 !important;
}

.logo-brand, .logo-brand * {
    text-decoration: none !important;
}

/* Containers */

.auth-container,
.admin-container {
    max-width: 420px;
    margin: 0 auto !important;
    padding: 30px !important;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    box-shadow: none;
}

.admin-container {
    max-width: 1000px !important;
    width: 100% !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 15px !important;
    box-shadow: none !important;
    padding: 30px !important;
    margin: 0 auto !important;
}

/* Títulos */

h2,h3 {
    margin-top: 0;
    color: #2982C4;
}

.page-title {
    color: #333;
    text-align: left;
    margin: 0 0 30px 0;
    font-size: 2.2em;
    font-weight: 700;
}

/* INPUTS GIGANTES (forçado) */

input,
button {
    width: 100% !important;
    min-height: 56px !important;
    padding: 18px !important;
    margin-bottom: 14px !important;
    border-radius: 14px !important;
    border: 1px solid #ccc !important;
    font-size: 18px !important;
}

/* Botões */

button {
    background: #2982C4 !important;
    color: white !important;
    font-weight: 700;
    cursor: pointer;
}

input[type="radio"], 
input[type="checkbox"] {
    width: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
}

.radio-mark {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
    display: inline-block !important;
    position: relative;
}

/* Links */

a {
    color: #2982C4;
    font-weight: 600;
}

/* Footer */

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    padding: 24px 20px 40px;
}

/* Mobile */

@media (max-width: 600px) {

    input,
    button {
        font-size: 20px !important;
        min-height: 60px !important;
    }
    .topbar-brand .brand-text .slogan {
        display: none !important;
    }
    .slogan { display: none !important; }

}

/* Overrides para telas internas (Configurações e Admin) */
.config-form input,
.config-form select,
.config-form button,
.section.card input,
.section.card select,
.section.card button {
    width: 260px !important;
    min-height: 40px !important;
    padding: 8px 12px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    margin-bottom: 10px !important;
}
.config-form button,
.section.card button {
    width: auto !important;
    padding: 10px 16px !important;
}

.admin-container input,
.admin-container button {
    width: 320px !important;
    min-height: 40px !important;
    padding: 8px 12px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    margin-bottom: 10px !important;
}
.admin-container button {
    width: auto !important;
    padding: 10px 16px !important;
}

/* Botão Painel Admin no sistema */

.admin-bar {
    max-width: 760px;
    margin: 20px auto !important;
    padding: 0 15px;
    text-align: center !important;
}

.admin-bar a {
    display: inline-block;
    background: #2982C4;
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
}

.admin-bar a:hover {
    opacity: .9;
}

.btn { background: var(--blue); color: #fff; border: none; border-radius: 8px; padding: 12px 18px; font-weight: 700; cursor: pointer; }

.btn-danger, 
button.btn-danger { 
    background: #e53935 !important; 
    color: #fff !important; 
    border: 1px solid #c62828 !important; 
}

input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(41,130,196,0.15); outline: none; }

/* Auto dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --blue: #6aa4cf;
        --green: #3dbf7b;
        --muted: #b6bcc5;
    }

    html, body {
        background: #2f3136 !important;
        color: #e6e9ee !important;
    }

    .auth-container,
    .admin-container {
        background: #3a3d42 !important;
        border-color: #4e5259 !important;
        box-shadow: none !important;
        color: #e6e9ee !important;
    }

    .page-title {
        color: #f0f2f5 !important;
    }

    h2, h3 {
        color: #c4d7e8 !important;
    }

    input,
    select,
    textarea {
        background: #44484f !important;
        color: #e6e9ee !important;
        border-color: #4e5259 !important;
    }

    input[type="checkbox"],
    input[type="radio"] {
        -webkit-appearance: auto !important;
        appearance: auto !important;
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        color-scheme: light !important;
        accent-color: #4f6bed !important;
    }

    input::placeholder,
    textarea::placeholder {
        color: #b6bcc5 !important;
    }

    input:focus,
    select:focus,
    textarea:focus {
        border-color: #78add3 !important;
        box-shadow: 0 0 0 3px rgba(120, 173, 211, 0.20) !important;
    }

    a {
        color: #9fc0d8;
    }

    .footer {
        color: #b6bcc5 !important;
    }

    .btn-danger,
    button.btn-danger {
        background: #b91c1c !important;
        border-color: #dc2626 !important;
    }
}

/* Texto vermelho mais legível no dark mode (somente texto) */
html[data-theme="dark"] [style*="color:red"],
html[data-theme="dark"] [style*="color: red"],
html[data-theme="dark"] [style*="color:#b71c1c"],
html[data-theme="dark"] [style*="color: #b71c1c"],
html[data-theme="dark"] [style*="color:#c62828"],
html[data-theme="dark"] [style*="color: #c62828"],
html[data-theme="dark"] [style*="color:#dc2626"],
html[data-theme="dark"] [style*="color: #dc2626"],
html[data-theme="dark"] [style*="color:#ef4444"],
html[data-theme="dark"] [style*="color: #ef4444"],
html[data-theme="dark"] [style*="color:#f44336"],
html[data-theme="dark"] [style*="color: #f44336"],
html[data-theme="dark"] .terms-error {
    color: #ffb4b4 !important;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] [style*="color:red"],
    html[data-theme="auto"] [style*="color: red"],
    html[data-theme="auto"] [style*="color:#b71c1c"],
    html[data-theme="auto"] [style*="color: #b71c1c"],
    html[data-theme="auto"] [style*="color:#c62828"],
    html[data-theme="auto"] [style*="color: #c62828"],
    html[data-theme="auto"] [style*="color:#dc2626"],
    html[data-theme="auto"] [style*="color: #dc2626"],
    html[data-theme="auto"] [style*="color:#ef4444"],
    html[data-theme="auto"] [style*="color: #ef4444"],
    html[data-theme="auto"] [style*="color:#f44336"],
    html[data-theme="auto"] [style*="color: #f44336"],
    html[data-theme="auto"] .terms-error {
        color: #ffb4b4 !important;
    }
}
