:root {
    --bg: #010302;
    --fg: #e6edf3;
    --card: #010302;
    --card-fg: var(--fg);
    --muted: #0f1a28;
    --muted-fg: rgba(230, 237, 243, .65);
    --accent: #101010;
    --border: rgba(148, 163, 184, .18);
    --input: rgba(148, 163, 184, .22);
    --primary: #de0000;
    --primary-fg: #ffffff;
    --success: #10b981;
    --success-fg: #06281d;
    --warning: #f59e0b;
    --warning-fg: #2a1600;
    --destructive: #ef4444;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .35);
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { 
    box-sizing: border-box; 
}

html, body { 
    height: 100%; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { 
    color: inherit; 
    text-decoration: none; 
}

button, input { 
    font: inherit; 
    color: inherit; 
}

svg { 
    display: block; 
}

img, video { 
    max-width: 100%; 
    height: auto; 
    display: block; 
}

h1,h2,h3,h4,h5,h6 { 
    font-size: inherit; 
    font-weight: inherit; 
    margin: 0; 
}

ul, ol { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
}

table { 
    border-collapse: collapse; 
}

/* Flex utilities */
.flex { 
    display: flex; 
}

.flex-col { 
    flex-direction: column; 
}

.flex-1 { 
    flex: 1; 
}

.items-center { 
    align-items: center; 
}

.items-start { 
    align-items: flex-start; 
}

.justify-between { 
    justify-content: space-between; 
}

.gap-1 { 
    gap: .25rem; 
}

.gap-2 { 
    gap: .5rem; 
}

.gap-3 { 
    gap: .75rem; 
}

.gap-4 { 
    gap: 1rem; 
}

.shrink-0 { 
    flex-shrink: 0; 
}

.w-full { 
    width: 100%; 
}

.relative { 
    position: relative; 
}

.hidden { 
    display: none; 
}

.text-muted { 
    color: var(--muted-fg); 
}

.font-medium { 
    font-weight: 500; 
}

.font-semibold { 
    font-weight: 600; 
}

.font-bold { 
    font-weight: 700; 
}

.text-xs { 
    font-size: .75rem; 
}

.text-sm { 
    font-size: .875rem; 
}

.text-2xl { 
    font-size: 1.5rem; 
    letter-spacing: -.02em; 
}

.mt-1 { 
    margin-top: .25rem; 
}

.mt-2 { 
    margin-top: .5rem; 
}

.mt-4 { 
    margin-top: 1rem; 
}

.mb-4 { 
    margin-bottom: 1rem; 
}

.mb-6 { 
    margin-bottom: 1.5rem; 
}

.space-y-1 > * + * { 
    margin-top: .25rem; 
}

.space-y-2 > * + * { 
    margin-top: .5rem; 
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: color-mix(in oklab, var(--bg) 80%, transparent);
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
}

.topbar__inner {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.sidebar-letreiro {
    width: 200px;
    height: 55px;
    border-radius: 8px;
    object-fit: contain;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.card {
    background: var(--bg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease;
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    gap: 1.5rem;
    display: flex;
    flex-direction: column;
}

#loginForm {

    gap: 1.5rem;
    display: flex;
    flex-direction: column;
}

.card-header {
    text-align: center;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--fg);
    margin-bottom: 0.5rem;
}

.card-subtitle {
    font-size: 1rem;
    color: var(--muted-fg);
}

.form-item {
    display: grid;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    color: var(--fg);
}

.form-label[data-error="true"] { 
    color: var(--destructive); 
}

.form-input {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 1rem;
    border-radius: 10px;
    border: 1px solid var(--input);
    background: var(--bg);
    color: var(--fg);
    font: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

.form-input::placeholder { 
    color: var(--muted-fg); 
    opacity: .8; 
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 20%, transparent);
}

.form-input[aria-invalid="true"] { 
    color: var(--fg); 
}

.form-input:disabled { 
    opacity: .5; 
    pointer-events: none; 
}

/* Remove o fundo branco do preenchimento automático */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover, 
.form-input:-webkit-autofill:focus, 
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 100px var(--bg) inset !important;
    -webkit-text-fill-color: var(--fg) !important;
    transition: background-color 5000s ease;
}

.btn {
    height: 48px;
    width: 100%;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background .15s ease, transform .05s ease;
    text-align: center;
    background: var(--primary);
    color: var(--primary-fg);
}

.btn:hover { 
    background: color-mix(in oklab, var(--primary) 92%, black);  
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}


@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .topbar__inner {
        height: 100px;
        padding: 0 1rem;
    }
    
    .sidebar-letreiro {
        width: 150px;
        height: 45px;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
        max-width: 100%;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .card-subtitle {
        font-size: 0.875rem;
    }
    
    .form-input {
        height: 44px;
        font-size: 1rem;
    }
    
    .btn {
        height: 44px;
        font-size: 1rem;
    }
    
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 1.25rem;
    }
    
    .card-title {
        font-size: 1.125rem;
    }
    
    .form-input {
        height: 40px;
        font-size: 0.875rem;
        padding: 0 0.75rem;
    }
    
    .btn {
        height: 40px;
        font-size: 0.875rem;
    }
}
