/* =========================================
   CONFIGURACIÓN GLOBAL Y RESET
   ========================================= */
* {
    box-sizing: border-box; /* Corrige el desbordamiento de inputs */
    margin: 0;
    padding: 0;
}

:root {
    --medra-blue: #3A5795;
    --medra-hover: #2d4373;
    --bg-light: #f4f6f8;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-soft: #dcdfe6;
    --white: #ffffff;
    --error: #e53e3e;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

/* =========================================
   HEADER (ESTILO CORPORATIVO)
   ========================================= */
.header {
    background-color: var(--medra-blue);
    height: 70px;
    display: flex;
    justify-content: center; 
    align-items: center;
    color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-logo-shield img {
    height: 45px;
    width: auto;
    filter: brightness(0) invert(1); /* Mantiene el logo en blanco */
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.brand-name {
    font-size: 26px;
    font-weight: 700;
    text-transform: lowercase;
    line-height: 1;
}

.brand-tag {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

/* =========================================
   CONTENEDOR PRINCIPAL
   ========================================= */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* =========================================
   PANEL DE LOGIN (MODAL)
   ========================================= */
.login-panel {
    width: 100%;
    max-width: 420px;
    padding: 45px 40px;
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.login-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
}

.login-subtitle {
    margin: 10px 0 35px 0;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

/* =========================================
   FORMULARIO E INPUTS
   ========================================= */
#loginForm {
    width: 100%;
}

.form-group {
    margin-bottom: 22px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
}

.form-group input {
    width: 100%; /* El input no desbordará gracias a box-sizing: border-box */
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    font-size: 14px;
    background-color: #fafafa;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    border-color: var(--medra-blue);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(58, 87, 149, 0.1);
}

.caps-warning {
    display: none;
    color: var(--error);
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}

/* =========================================
   BOTÓN DE ACCIÓN
   ========================================= */
.btn-conectar {
    width: 100%;
    padding: 14px;
    background-color: var(--medra-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-conectar:hover {
    background-color: var(--medra-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 87, 149, 0.2);
}

.change-link {
    margin-top: 25px;
}

.change-link a {
    color: var(--medra-blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.change-link a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    background-color: var(--white);
    padding: 20px;
    border-top: 1px solid var(--border-soft);
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.footer-separator {
    color: #d1d5db;
}

.policy-link {
    color: var(--medra-blue);
    text-decoration: none;
    font-weight: 600;
}

.policy-link:hover {
    text-decoration: underline;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 480px) {
    .login-panel {
        padding: 30px 20px;
        border: none;
        box-shadow: none;
        background: transparent;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-separator {
        display: none;
    }
}