body {
    font-family: "Helvetica", sans-serif;
    min-height: 100vh;
    background-repeat: repeat;
    background-color: #8a8a8a;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

@keyframes spinner {
    0% {
        transform: rotateZ(0deg);
    }
    100% {
        transform: rotateZ(359deg);
    }
}

* {
    box-sizing: border-box;
}

/* CONTENEDOR PRINCIPAL */
.login-container {
    display: flex;
    max-width: 1200px;
    width: 95%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    min-height: 500px;
    margin: 20px auto;
}

/* PANEL IZQUIERDO - INFORMACIÓN */
.info-panel {
    flex: 1;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 400px;
}

.logo-section {
    margin-bottom: 30px;
    text-align: center;
}

.logo-section img {
    max-width: 100px;
    height: auto;
    margin-bottom: 15px;
}

.system-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #FFC600;
    line-height: 1.2;
}

.system-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 20px;
    line-height: 1.3;
}

.features-list {
    text-align: left;
    margin-top: 25px;
    width: 100%;
    max-width: 280px;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.3;
}

.feature-item i {
    color: #FFC600;
    margin-right: 10px;
    font-size: 14px;
    min-width: 16px;
}

/* PANEL DERECHO - FORMULARIO */
.form-panel {
    flex: 1;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #f8f9fa;
    min-height: 400px;
}

.form-header {
    text-align: center;
    margin-bottom: 25px;
}

.form-header h2 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 24px;
    line-height: 1.2;
}

.form-header p {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.3;
}

/* ESTILOS DEL FORMULARIO */
form.login {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
    margin-top: 3px;
}

.input-group input {
    width: 100%;
    padding: 14px 45px 14px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    background: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    color: #333;
    font-family: "Helvetica", sans-serif;
    height: 50px;
}

/* Placeholders con buen margen */
.input-group input::placeholder {
    color: #999;
    font-size: 14px;
    letter-spacing: 0.3px;
}

/* Input de usuario con icono a la izquierda */
.input-group.user-input input {
    padding: 14px 15px 14px 48px;
}

.input-group.user-input::before {
    content: '\f007';
    font-family: 'FontAwesome';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    font-size: 16px;
    z-index: 2;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Input de password con icono de candado a la izquierda */
.input-group.password-input input {
    padding: 14px 45px 14px 48px;
}

.input-group.password-input::before {
    content: '\f023';
    font-family: 'FontAwesome';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    font-size: 16px;
    z-index: 2;
    transition: all 0.3s ease;
    pointer-events: none;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 15px;
    padding: 6px;
    transition: color 0.3s ease;
    z-index: 3;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #667eea;
}

.input-group input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.2);
    outline: none;
}

.input-group input:not(:placeholder-shown) {
    padding-left: 48px;
}

.input-group.user-input input:focus,
.input-group.password-input input:focus {
    padding-left: 48px;
}

.input-group input:focus + .password-toggle,
.input-group.user-input input:focus::before,
.input-group.password-input input:focus::before {
    color: #667eea;
}

/* BOTÓN DE INGRESAR CON MÁRGENES CORREGIDOS */
form.login button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px; /* Margen superior de 10px */
    margin-bottom: 5px; /* Margen inferior de 5px */
    position: relative;
    overflow: hidden;
    height: 50px;
}

form.login button[type="submit"]:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* SPINNER DEL BOTÓN */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.state {
    display: inline-block;
    font-size: 15px;
}

/* FOOTER CORREGIDO - MISMO ANCHO QUE EL FORM */
.form-footer-container {
    width: 100%;
    max-width: 350px;
    margin: 0 auto; /* Eliminado el margin-top ya que el botón tiene su margen */
    display: flex;
    justify-content: center;
}

footer {
    text-align: center;
    padding: 15px;
    background: rgba(44, 62, 80, 0.9);
    color: white;
    border-radius: 6px;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}

footer img {
    max-width: 60px;
    margin-bottom: 8px;
}

footer p {
    margin: 4px 0;
    font-size: 11px;
    line-height: 1.3;
}

/* MEJORAS ESPECÍFICAS PARA DISTRIBUCIÓN */
.form-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.form-fields {
    width: 100%;
    max-width: 350px;
    margin-bottom: 0; /* Aseguramos que no haya margen extra */
}

/* ========== MEDIA QUERIES RESPONSIVE CORREGIDAS ========== */

/* TABLETS (768px - 1024px) */
@media (max-width: 1024px) {
    .login-container {
        max-width: 900px;
        width: 90%;
        min-height: 450px;
        margin: 15px auto;
    }
    
    .info-panel {
        padding: 30px 20px;
    }
    
    .form-panel {
        padding: 25px 30px;
    }
    
    .logo-section img {
        max-width: 90px;
    }
    
    .system-title {
        font-size: 20px;
    }
    
    .features-list {
        max-width: 240px;
    }
    
    .feature-item {
        font-size: 12px;
    }
}

/* TABLETS PEQUEÑAS (600px - 768px) */
@media (max-width: 768px) {
    body {
        padding: 10px;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .login-container {
        flex-direction: column;
        width: 100%;
        max-width: 500px;
        min-height: auto;
        margin: 0 auto;
        border-radius: 10px;
    }
    
    .info-panel, .form-panel {
        padding: 25px 20px;
        min-height: auto;
        width: 100%;
    }
    
    .info-panel {
        order: 2;
        padding-bottom: 30px;
    }
    
    .form-panel {
        order: 1;
        padding-top: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .logo-section img {
        max-width: 80px;
    }
    
    .system-title {
        font-size: 18px;
    }
    
    .features-list {
        max-width: 100%;
        text-align: center;
    }
    
    .feature-item {
        justify-content: center;
        font-size: 13px;
    }
    
    form.login {
        max-width: 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .form-header h2 {
        font-size: 22px;
    }
    
    .form-content {
        width: 100%;
        align-items: center;
    }
    
    .form-fields {
        width: 100%;
        max-width: 350px;
    }
}

/* MÓVILES GRANDES (480px - 600px) */
@media (max-width: 600px) {
    body {
        padding: 8px;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .login-container {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        border-radius: 8px;
    }
    
    .info-panel, .form-panel {
        padding: 20px 15px;
        width: 100%;
    }
    
    .form-panel {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .logo-section img {
        max-width: 70px;
    }
    
    .system-title {
        font-size: 18px;
    }
    
    .system-subtitle {
        font-size: 13px;
    }
    
    .form-header {
        width: 100%;
        text-align: center;
    }
    
    .form-header h2 {
        font-size: 20px;
    }
    
    .form-header p {
        font-size: 13px;
    }
    
    .input-group {
        width: 100%;
    }
    
    .input-group input {
        height: 48px;
        font-size: 14px;
        padding: 13px 42px 13px 42px;
    }
    
    .input-group.user-input input {
        padding: 13px 15px 13px 45px;
    }
    
    .input-group.password-input input {
        padding: 13px 42px 13px 45px;
    }
    
    .input-group.user-input::before,
    .input-group.password-input::before {
        left: 15px;
        font-size: 15px;
    }
    
    .password-toggle {
        right: 12px;
        font-size: 14px;
    }
    
    form.login button[type="submit"] {
        height: 48px;
        font-size: 15px;
        margin-top: 10px;
        margin-bottom: 5px;
        width: 100%;
    }
    
    .form-fields {
        width: 100%;
        max-width: 320px;
    }
    
    footer {
        max-width: 320px;
        padding: 12px;
    }
}

/* MÓVILES PEQUEÑOS (hasta 480px) */
@media (max-width: 480px) {
    body {
        padding: 5px;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .login-container {
        margin: 0 auto;
        border-radius: 6px;
        width: 100%;
        max-width: 100%;
    }
    
    .info-panel, .form-panel {
        padding: 15px 12px;
        min-height: auto;
        width: 100%;
    }
    
    .form-panel {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .logo-section img {
        max-width: 60px;
    }
    
    .system-title {
        font-size: 16px;
    }
    
    .system-subtitle {
        font-size: 12px;
    }
    
    .feature-item {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .form-header {
        margin-bottom: 20px;
        width: 100%;
        text-align: center;
    }
    
    .form-header h2 {
        font-size: 18px;
    }
    
    .form-header p {
        font-size: 12px;
    }
    
    .input-group {
        margin-bottom: 15px;
        width: 100%;
    }
    
    .input-group input {
        height: 46px;
        font-size: 14px;
        padding: 12px 40px 12px 40px;
    }
    
    .input-group.user-input input {
        padding: 12px 12px 12px 42px;
    }
    
    .input-group.password-input input {
        padding: 12px 40px 12px 42px;
    }
    
    .input-group.user-input::before,
    .input-group.password-input::before {
        left: 14px;
        font-size: 14px;
    }
    
    .password-toggle {
        right: 10px;
        font-size: 13px;
        width: 20px;
        height: 20px;
    }
    
    form.login button[type="submit"] {
        height: 46px;
        font-size: 14px;
        padding: 12px;
        margin-top: 10px;
        margin-bottom: 5px;
        width: 100%;
    }
    
    .form-fields {
        width: 100%;
        max-width: 280px;
    }
    
    .form-footer-container {
        max-width: 100%;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    footer {
        max-width: 280px;
        padding: 10px;
        margin: 0 auto;
    }
    
    footer img {
        max-width: 50px;
    }
    
    footer p {
        font-size: 10px;
    }
}

/* MONITORES GRANDES (1280px+) */
@media (min-width: 1280px) {
    .login-container {
        max-width: 1100px;
        min-height: 600px;
        margin: 20px auto;
    }
    
    .info-panel {
        padding: 50px 40px;
    }
    
    .form-panel {
        padding: 50px;
    }
    
    .logo-section img {
        max-width: 120px;
    }
    
    .system-title {
        font-size: 26px;
    }
    
    .system-subtitle {
        font-size: 16px;
    }
    
    .features-list {
        max-width: 300px;
    }
    
    .feature-item {
        font-size: 14px;
    }
    
    .form-header h2 {
        font-size: 28px;
    }
    
    .form-header p {
        font-size: 15px;
    }
    
    .input-group input {
        height: 55px;
        font-size: 16px;
    }
    
    form.login button[type="submit"] {
        height: 55px;
        font-size: 17px;
        margin-top: 10px;
        margin-bottom: 5px;
    }
}

/* CORRECCIÓN ESPECÍFICA PARA CENTRADO EN MÓVILES */
@media (max-width: 768px) {
    .form-panel {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 50vh;
    }
    
    .form-content {
        width: 100%;
        max-width: 350px;
        margin: 0 auto;
    }
    
    form.login {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* GARANTIZAR QUE EL FOOTER NUNCA SE DESCENTRE */
.form-panel .form-content {
    align-items: center;
}