/* ===== FleetDriver Login v1.0 - CSS Completo ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-blue: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-lighter: #60a5fa;
    --aia-green: #4ade80;
    --aia-teal: #14b8a6;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --error-red: #ef4444;
    --error-dark: #b91c1c;
    --white: #ffffff;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-light) 50%, var(--aia-teal) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
     overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(74, 222, 128, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    animation: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); }
}

.login-container {
    background: var(--white);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== Logos no Topo ===== */
.header-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--gray-100);
}

.logo-aia,
.logo-fleetdriver {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    max-width: 100%;
    height: auto;
    max-height: 50px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.logo-divider {
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        var(--gray-300) 20%, 
        var(--gray-300) 80%, 
        transparent 100%);
}

/* ===== Header ===== */
.header-container {
    text-align: center;
    margin-bottom: 32px;
}

.system-subtitle {
    font-size: 16px;
    color: var(--gray-600);
    font-weight: 600;
    margin-bottom: 12px;
}

.version-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--aia-teal) 0%, var(--aia-green) 100%);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* ===== Form ===== */
.login-form {
    margin-top: 24px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.label-icon {
    font-size: 20px;
}

.form-input {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--gray-800);
    background: var(--white);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    font-weight: 500;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--aia-teal);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    padding: 8px;
    opacity: 0.6;
    transition: all 0.2s;
    border-radius: 8px;
}

.toggle-password:hover {
    opacity: 1;
    background: var(--gray-100);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}

/* ===== Hints e Displays ===== */
.input-hint {
    margin-top: 8px;
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
}

.password-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.05) 0%, rgba(74, 222, 128, 0.05) 100%);
    border-radius: 8px;
    border-left: 3px solid var(--aia-teal);
}

.nome-display {
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border: 2px solid #22c55e;
    border-radius: 12px;
    color: #15803d;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.nome-display.fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Botão de Login ===== */
.login-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--aia-teal) 100%);
    color: var(--white);
    border: none;
    padding: 18px 28px;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.25);
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
}

.login-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(20, 184, 166, 0.35);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--aia-green) 100%);
}

.login-button:active:not(:disabled) {
    transform: translateY(0);
}

.login-button:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Mensagens de Erro ===== */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--error-red);
    color: var(--error-dark);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Seletor de Empresa ===== */
.empresa-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empresa-option {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.empresa-option:hover {
    border-color: var(--primary-light);
    background: var(--gray-50);
    transform: translateY(-2px);
}

.empresa-option.selected {
    border-color: var(--primary-light);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.empresa-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.empresa-option-info {
    flex: 1;
}

.empresa-nome {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.empresa-matricula {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 600;
}

.empresa-badge {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-light) 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Footer ===== */
.footer-info {
    text-align: center;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.company-name {
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 700;
    margin-bottom: 8px;
}

.powered-by {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--aia-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Responsivo ===== */
@media (max-width: 480px) {
    .login-container {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .header-logos {
        gap: 16px;
    }

    .logo-img {
        max-height: 40px;
    }

    .logo-divider {
        height: 32px;
    }

    .form-input {
        padding: 14px 16px;
        font-size: 16px;
    }

    .login-button {
        padding: 16px 24px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 12px;
    }

    .login-container {
        padding: 28px 20px;
    }

    .header-logos {
        flex-direction: column;
        gap: 12px;
    }

    .logo-divider {
        width: 60%;
        height: 2px;
        background: linear-gradient(to right, 
            transparent 0%, 
            var(--gray-300) 20%, 
            var(--gray-300) 80%, 
            transparent 100%);
    }

    .logo-img {
        max-height: 36px;
    }
}

/* ===== Acessibilidade ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
@media (max-width: 480px) {
    body {
        padding: 20px;
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .login-container {
        padding: 32px 24px;
        border-radius: 20px;
        margin: 20px auto;  /* ✅ Garantir margem */
    }
    
    /* resto... */
}
