/* ========================================
   HABITACIONAL - Sistema Moderno de Login
   Governo do Estado do Amapá
   ======================================== */

/* ========== RESET E VARIÁVEIS ========== */
:root {
    /* Cores baseadas no logo do Amapá */
    --primary-green: #2ecc71;
    --primary-blue: #3498db;
    --primary-purple: #9b59b6;
    --primary-orange: #e67e22;
    --primary-yellow: #f1c40f;
    
    /* Cores do sistema */
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --card-bg: #ffffff;
    --input-bg: #f8f9fa;
    --input-border: #e0e0e0;
    --input-focus: #667eea;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --success: #27ae60;
    --error: #e74c3c;
    --warning: #f39c12;
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
    
    /* Transições */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

/* ========== BODY E BACKGROUND ========== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Efeito de partículas no fundo */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* ========== CONTAINER PRINCIPAL ========== */
.box-cpf {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    position: relative;
    animation: slideUp 0.5s ease;
}

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

/* ========== LOGO ========== */
.logo-morar-bem {
    display: block;
    margin: 0 auto 30px;
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== CAMPOS DO FORMULÁRIO ========== */
.box-campos {
    width: 100%;
}

/* Título e descrições */
.ls-txt-center {
    text-align: center;
    margin-bottom: 25px;
}

.ls-login-signup {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
}

.ls-login-signup strong {
    color: var(--primary-purple);
    font-weight: 600;
}

/* ========== LABELS E INPUTS ========== */
.ls-label {
    display: block;
    margin-bottom: 20px;
    width: 100%;
}

.ls-label-text {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.ls-hidden-accessible {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Inputs */
.ls-field,
.ls-field-lg,
input[type="text"],
input[type="password"],
select.ls-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--input-border);
    border-radius: 10px;
    font-size: 15px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all var(--transition-normal);
    outline: none;
}

.ls-field:focus,
.ls-field-lg:focus,
input[type="text"]:focus,
input[type="password"]:focus,
select.ls-select:focus {
    border-color: var(--input-focus);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.ls-field:disabled,
.ls-field-lg:disabled,
input[type="text"]:disabled {
    background: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Inputs com ícones */
.ls-prefix-group {
    position: relative;
    display: flex;
    align-items: center;
}

.ls-prefix-group input {
    padding-right: 45px;
}

.ls-label-text-prefix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 20px;
    transition: color var(--transition-fast);
    padding: 8px;
}

.ls-label-text-prefix:hover {
    color: var(--input-focus);
}

/* ========== BOTÕES ========== */
.ls-btn-primary,
input[type="submit"] {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-blue) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.ls-btn-primary:hover,
input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #8e44ad 0%, #2980b9 100%);
}

.ls-btn-primary:active,
input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.ls-btn-primary:disabled,
input[type="submit"]:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* Loading state */
.ls-btn-primary.loading,
input[type="submit"].loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.ls-btn-primary.loading::after,
input[type="submit"].loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* ========== LINKS ========== */
.ls-login-forgot {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition-fast);
    display: inline-block;
}

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

/* ========== ALERTAS ========== */
.ls-alert-danger,
.ls-alert-warning,
.ls-alert-success {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ls-alert-danger {
    background: #fee;
    color: #c33;
    border-left: 4px solid var(--error);
}

.ls-alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning);
}

.ls-alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

/* ========== SELECT CUSTOMIZADO ========== */
.ls-custom-select {
    position: relative;
}

.ls-custom-select::after {
    content: '?';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
    font-size: 12px;
}

.ls-custom-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
}

/* ========== INDICADOR DE FORÇA DE SENHA ========== */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: var(--input-border);
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.password-strength.active {
    display: block;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all var(--transition-normal);
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: var(--error);
}

.password-strength-bar.medium {
    width: 66%;
    background: var(--warning);
}

.password-strength-bar.strong {
    width: 100%;
    background: var(--success);
}

.password-strength-text {
    font-size: 12px;
    margin-top: 4px;
    color: var(--text-secondary);
}

/* ========== RESPONSIVIDADE ========== */
@media (max-width: 480px) {
    .box-cpf {
        padding: 30px 20px;
        border-radius: 15px;
    }
    
    .logo-morar-bem {
        max-width: 160px;
        margin-bottom: 20px;
    }
    
    .ls-login-signup {
        font-size: 14px;
    }
    
    .ls-field,
    .ls-field-lg,
    input[type="text"],
    input[type="password"],
    select.ls-select {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .ls-btn-primary,
    input[type="submit"] {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* ========== ACESSIBILIDADE ========== */
*:focus-visible {
    outline: 3px solid var(--input-focus);
    outline-offset: 2px;
}

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

/* ========== ANIMAÇÕES ADICIONAIS ========== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========== UTILITÁRIOS ========== */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 16px;
}

.mb-2 {
    margin-bottom: 16px;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}
