/* =====================================================
   ESTILOS DO SISTEMA DE LOGIN - PREMOLDÇO
   Visual Moderno e Profissional
   ===================================================== */

/* CSS Reset e Variaveis */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-bg: linear-gradient(135deg, #1e3a5f 0%, #0f172a 50%, #1a1a2e 100%);
}

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

/* Container Principal */
.login-container {
    width: 100%;
    max-width: 450px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card de Login */
.login-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 45px 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

/* Logo e Header */
.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.logo-container {
    margin-bottom: 25px;
}

.logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Formulário */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.form-group input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-group input:focus {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.form-group input:focus + i,
.form-group:focus-within i {
    color: var(--primary-color);
}

/* Checkbox Lembre-me */
.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 5px 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-wrapper span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.forgot-link {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Botao de Login */
.btn-login {
    width: 100%;
    padding: 16px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mensagens de Alerta */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.alert i {
    font-size: 1.2rem;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.login-footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Decorative Elements */
.decoration {
    position: fixed;
    pointer-events: none;
    z-index: -1;
}

.decoration-1 {
    top: 10%;
    left: 5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.decoration-2 {
    bottom: 15%;
    right: 8%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 10s ease-in-out infinite reverse;
}

.decoration-3 {
    top: 50%;
    right: 15%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

/* Responsivo */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .login-card {
        padding: 35px 25px;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .logo {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .form-group input {
        padding: 12px 14px 12px 44px;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible para acessibilidade */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Input com erro */
.input-error {
    border-color: var(--danger-color) !important;
}

.input-error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
}


/* =====================================================
   ESTILOS PARA SELECTS E INPUTS - TEMA ESCURO
   ===================================================== */

/* Selects */
select,
select.form-control,
select.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--bg-dark) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 35px !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    font-size: 0.95rem;
    padding: 10px 35px 10px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 42px;
}

select:hover,
select:focus,
select.form-control:hover,
select.form-select:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
    outline: none;
}

select option {
    background-color: var(--bg-dark) !important;
    color: var(--text-primary) !important;
    padding: 10px !important;
}

/* Fix para Chrome/Safari */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select {
        padding-right: 35px !important;
    }
}

/* Firefox */
@-moz-document url-prefix() {
    select {
        padding-right: 35px !important;
    }
}

/* Inputs em geral */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
textarea {
    background-color: var(--bg-dark) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-secondary) !important;
}

/* Labels */
label {
    color: var(--text-secondary) !important;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

/* Grupo de formulário */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    margin-bottom: 5px;
}
