* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 50%, #009872 100%);
    min-height: 100vh;
    min-height: 100dvh; /* Para mejor soporte móvil */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 20px;
    /* FORZAR MODO MÓVIL - ESTAS SON LAS LÍNEAS CRÍTICAS */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    padding: clamp(30px, 4vw, 50px);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    color: #333;
}

.logo-container {
    text-align: center;
    margin-bottom: clamp(25px, 3vw, 35px);
}

.bull-icon {
    width: clamp(70px, 8vw, 90px);
    height: clamp(70px, 8vw, 90px);
    margin: 0 auto clamp(15px, 2vw, 20px);
    background: #00b894;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #00d4aa;
}

.bull-icon img {
    width: clamp(40px, 5vw, 60px);
    height: clamp(40px, 5vw, 60px);
    filter: brightness(0) invert(1);
}

.login-header h1 {
    color: #00b894;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 5px;
    text-align: center;
}

.login-header p {
    color: #666;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    text-align: center;
}

.form-group {
    margin-bottom: clamp(18px, 2.5vw, 25px);
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: clamp(6px, 1vw, 10px);
    color: #00b894;
    font-weight: 600;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: clamp(12px, 2vw, 16px) clamp(15px, 3vw, 20px) clamp(12px, 2vw, 16px) clamp(45px, 6vw, 55px);
    border: 2px solid #00b894;
    border-radius: 10px;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    background: #f8f9fa;
    color: #333;
    transition: all 0.3s ease;
    outline: none;
    /* MEJORAR EXPERIENCIA MÓVIL - ESTAS LÍNEAS SON IMPORTANTES */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-input:focus {
    border-color: #00d4aa;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 180, 148, 0.1);
}

.input-icon {
    position: absolute;
    left: clamp(15px, 3vw, 20px);
    top: 50%;
    transform: translateY(-50%);
    color: #00b894;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    right: clamp(15px, 3vw, 20px);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: clamp(1rem, 2vw, 1.2rem);
    padding: 5px;
    /* MEJORAR TÁCTIL MÓVIL */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: #00b894;
}

.login-button {
    width: 100%;
    padding: clamp(14px, 2.5vw, 18px);
    background: #00b894;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    /* MEJORAR TÁCTIL MÓVIL */
    min-height: 48px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.login-button:hover {
    background: #00d4aa;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 180, 148, 0.3);
}

.login-button:disabled {
    background: #ccc;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

.forgot-password-link {
    color: #00b894;
    text-decoration: none;
    font-weight: 500;
    display: block;
    text-align: center;
    margin-top: 15px;
    padding: clamp(8px, 1.5vw, 12px);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: clamp(0.9rem, 2vw, 1rem);
    /* MEJORAR TÁCTIL MÓVIL */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forgot-password-link:hover {
    color: #00d4aa;
    background: rgba(0, 180, 148, 0.1);
}

.error-msg {
    color: #dc3545;
    font-weight: 600;
    text-align: center;
    margin-top: 10px;
    display: none;
    padding: clamp(8px, 1.5vw, 12px);
    background: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
}

.form-input.error {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.form-input.success {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: clamp(25px, 4vw, 40px);
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    color: #333;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-icon {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 15px;
}

.modal-title {
    color: #00b894;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    margin-bottom: 10px;
}

.modal-message {
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-button {
    padding: clamp(10px, 2vw, 14px) clamp(20px, 4vw, 30px);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: clamp(0.9rem, 2vw, 1rem);
    /* MEJORAR TÁCTIL MÓVIL */
    min-height: 44px;
    min-width: 100px;
}

.btn-primary {
    background: #00b894;
    color: #fff;
}

.btn-primary:hover {
    background: #00d4aa;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.success-modal .modal-title {
    color: #28a745;
}

.success-modal .btn-primary {
    background: #28a745;
}

.success-modal .btn-primary:hover {
    background: #34ce57;
}

/* Animación suave para errores */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.3s ease-in-out;
}

/* RESPONSIVE DESIGN - TABLET 12 PULGADAS Y OTROS DISPOSITIVOS */

/* Tablet 12 pulgadas horizontal (1366x1024) */
@media screen and (min-width: 1200px) and (max-width: 1400px) {
    .login-container {
        max-width: 520px;
        padding: 60px 50px;
    }
    
    .bull-icon {
        width: 100px;
        height: 100px;
        margin-bottom: 25px;
    }
    
    .bull-icon img {
        width: 60px;
        height: 60px;
    }
    
    .login-header h1 {
        font-size: 2.2rem;
        margin-bottom: 8px;
    }
    
    .login-header p {
        font-size: 1.2rem;
    }
    
    .form-group {
        margin-bottom: 28px;
    }
    
    .form-label {
        margin-bottom: 12px;
        font-size: 1.1rem;
    }
    
    .form-input {
        padding: 18px 25px 18px 60px;
        font-size: 1.2rem;
        border-radius: 12px;
    }
    
    .input-icon {
        left: 22px;
        font-size: 1.4rem;
    }
    
    .toggle-password {
        right: 22px;
        font-size: 1.3rem;
        padding: 8px;
    }
    
    .login-button {
        padding: 20px;
        font-size: 1.3rem;
        border-radius: 12px;
        margin-top: 15px;
    }
    
    .forgot-password-link {
        margin-top: 20px;
        padding: 12px;
        font-size: 1.1rem;
        border-radius: 10px;
    }
    
    .modal-content {
        max-width: 550px;
        padding: 50px 45px;
    }
}

/* Tablet 12 pulgadas vertical (1024x1366) */
@media screen and (min-width: 1000px) and (max-width: 1199px) {
    .login-container {
        max-width: 480px;
        padding: 50px 45px;
    }
    
    .bull-icon {
        width: 90px;
        height: 90px;
    }
    
    .bull-icon img {
        width: 55px;
        height: 55px;
    }
    
    .login-header h1 {
        font-size: 2rem;
    }
    
    .form-input {
        padding: 16px 22px 16px 55px;
        font-size: 1.1rem;
    }
    
    .input-icon {
        left: 20px;
        font-size: 1.3rem;
    }
    
    .toggle-password {
        right: 20px;
        font-size: 1.2rem;
    }
    
    .login-button {
        padding: 18px;
        font-size: 1.2rem;
    }
}

/* Tablets medianas (768px - 999px) */
@media screen and (min-width: 768px) and (max-width: 999px) {
    .login-container {
        max-width: 450px;
        padding: 45px 40px;
    }
    
    .bull-icon {
        width: 85px;
        height: 85px;
    }
    
    .login-header h1 {
        font-size: 1.9rem;
    }
    
    .form-input {
        padding: 15px 20px 15px 50px;
    }
    
    .modal-content {
        max-width: 480px;
        padding: 40px 35px;
    }
}

/* Móviles grandes (481px - 767px) */
@media screen and (max-width: 767px) {
    body {
        padding: 15px;
    }
    
    .login-container {
        max-width: 100%;
        padding: 35px 30px;
        margin: 0 10px;
    }
    
    .bull-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 15px;
    }
    
    .bull-icon img {
        width: 50px;
        height: 50px;
    }
    
    .login-header h1 {
        font-size: 1.8rem;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-input {
        padding: 14px 18px 14px 48px;
    }
    
    .input-icon {
        left: 18px;
    }
    
    .toggle-password {
        right: 18px;
    }
    
    .modal-content {
        margin: 20px;
        padding: 30px 25px;
        max-width: calc(100% - 40px);
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-button {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Móviles pequeños (hasta 480px) */
@media screen and (max-width: 480px) {
    .login-container {
        padding: 30px 25px;
        border-radius: 18px;
    }
    
    .bull-icon {
        width: 75px;
        height: 75px;
    }
    
    .bull-icon img {
        width: 45px;
        height: 45px;
    }
    
    .login-header h1 {
        font-size: 1.6rem;
    }
    
    .login-header p {
        font-size: 0.95rem;
    }
    
    .form-input {
        padding: 12px 15px 12px 45px;
        font-size: 1rem;
    }
    
    .input-icon {
        left: 15px;
        font-size: 1.2rem;
    }
    
    .toggle-password {
        right: 15px;
        font-size: 1.1rem;
    }
    
    .login-button {
        padding: 14px;
        font-size: 1.1rem;
    }
    
    .forgot-password-link {
        font-size: 0.95rem;
    }
    
    .modal-content {
        padding: 25px 20px;
    }
}

/* Optimización para pantallas de alta densidad */
@media screen and (-webkit-min-device-pixel-ratio: 2), 
       screen and (min-resolution: 192dpi) {
    .login-container {
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    }
    
    .form-input {
        border-width: 1px;
    }
    
    .form-input:focus {
        border-width: 2px;
    }
}

/* Ajustes específicos para landscape en móviles */
@media screen and (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 10px;
    }
    
    .login-container {
        padding: 25px 30px;
        max-width: 400px;
    }
    
    .logo-container {
        margin-bottom: 20px;
    }
    
    .bull-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
    
    .bull-icon img {
        width: 35px;
        height: 35px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
        margin-bottom: 3px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-label {
        margin-bottom: 5px;
    }
}