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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e88e5 0%, #42a5f5 50%, #64b5f6 100%);
    background-image: url('../images/portada.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 136, 229, 0.8);
    backdrop-filter: blur(2px);
    z-index: -1;
}

.container {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 40px;
}

.logo-section {
    flex: 1;
    max-width: 500px;
    text-align: center;
    color: white;
    animation: slideInLeft 1s ease-out;
}

.logo img {
    width: 150px;
    height: 150px;
    margin-bottom: 30px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
    animation: float 3s ease-in-out infinite;
}

.welcome-text {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.login-container {
    flex: 1;
    max-width: 400px;
    animation: slideInRight 1s ease-out;
}

.mobile-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.mobile-header .logo img {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}

.mobile-header .welcome-text {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.mobile-header .subtitle {
    font-size: 1rem;
    margin-bottom: 0;
}

.login-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.3);
}

.login-form h2 {
    text-align: center;
    color: #1e88e5;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.login-form h2 i {
    margin-right: 10px;
    color: #ff9800;
}

.input-group {
    position: relative;
    margin-bottom: 30px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 15px;
    color: #1e88e5;
    z-index: 2;
    font-size: 1.25rem !important;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e3f2fd;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.9);
}

.input-group input:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
    transform: translateY(-2px);
}

.input-group input.valid {
    border-color: #4caf50;
}

.input-group input.invalid {
    border-color: #f44336;
}

.toggle-password {
    right: 15px !important;
    left: auto !important;
    cursor: pointer;
    color: #666 !important;
}

.toggle-password:hover {
    color: #1e88e5 !important;
}

.validation-message {
    display: flex;
    align-items: center;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(30, 136, 229, 0.1);
    border-radius: 8px;
    font-size: 13px;
    color: #1e88e5;
    transition: all 0.3s ease;
    animation: slideDown 0.3s ease-out;
}

.validation-message.hidden {
    display: none;
}

.validation-message i {
    margin-right: 8px;
    font-size: 12px;
    position: static;
}

.validation-message.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.validation-message.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.validation-message.success i:before {
    content: "\f00c";
}

.validation-message.error i:before {
    content: "\f071";
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 25px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 136, 229, 0.3);
}

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

.forgot-password {
    text-align: center;
    margin-bottom: 30px;
}

.forgot-password a {
    color: #1e88e5;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: #ff9800;
}

.social-login {
    text-align: center;
    border-top: 1px solid #e0e0e0;
    padding-top: 25px;
}

.social-login p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: white;
    transition: all 0.3s ease;
}

.social-btn.facebook {
    background: #3b5998;
}

.social-btn.whatsapp {
    background: #25d366;
}

.social-btn.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: 8% auto;
    padding: 40px;
    border-radius: 25px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.modal-content.success {
    border-top: 6px solid #4caf50;
}

.modal-content.error {
    border-top: 6px solid #f44336;
}

.modal-header {
    margin-bottom: 2rem;
}

.modal-header h3 {
    margin: 20px 0 15px 0;
    font-size: 1.5rem;
    color: #333;
}

.modal-header p {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 0;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.modal-icon, .success-icon, .error-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.modal-icon {
    color: #1e88e5;
}

.success-icon {
    color: #4caf50;
}

.error-icon {
    color: #f44336;
}

.progress-container {
    margin: 20px 0;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e88e5, #42a5f5, #64b5f6);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.airplane-progress {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    color: #ff9800;
    font-size: 1rem;
    transition: left 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: planeFloat 2s ease-in-out infinite;
}

.countdown-container {
    text-align: center;
}

.countdown-message {
    font-size: 1.1rem;
    color: #333;
}

.countdown-message strong {
    color: #1e88e5;
    font-size: 1.3rem;
}

.recovery-btn, .retry-btn, .ok-btn {
    padding: 15px 35px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recovery-btn {
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    color: white;
}

.retry-btn {
    background: linear-gradient(135deg, #f44336, #e57373);
    color: white;
}

.ok-btn {
    background: linear-gradient(135deg, #4caf50, #81c784);
    color: white;
}

.recovery-btn:hover, .retry-btn:hover, .ok-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Visibility classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

@keyframes planeFloat {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0px);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-3px);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 0;
        padding: 10px;
        justify-content: flex-start;
        padding-top: 20px;
    }
    
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
    
    .login-container {
        width: 100%;
        order: 1;
    }
    
    .login-form {
        padding: 30px 25px;
        margin: 0 10px;
    }
    
    .login-form h2 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .input-group {
        margin-bottom: 25px;
    }

    .input-group i {
        font-size: 1rem !important;
    }
    
    .validation-message {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .modal-content {
        margin: 15% auto;
        width: 95%;
        padding: 30px 25px;
    }
    
    .modal-header h3 {
        font-size: 1.3rem;
    }
    
    .modal-header p {
        font-size: 0.9rem;
    }
    
    .social-buttons {
        gap: 12px;
    }
    
    .social-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .progress-bar {
        height: 14px;
    }
    
    .airplane-progress {
        font-size: 1.3rem;
    }
    
    .countdown-message {
        font-size: 1rem;
    }
    
    .countdown-message strong {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .mobile-header .welcome-text {
        font-size: 1.5rem;
    }
    
    .mobile-header .subtitle {
        font-size: 0.9rem;
    }
    
    .login-form {
        padding: 25px 20px;
    }
    
    .login-form h2 {
        font-size: 1.3rem;
    }
    
    .input-group input {
        padding: 12px 12px 12px 40px;
        font-size: 14px;
    }
    
    .login-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    .modal-content {
        padding: 25px 20px;
    }
    
    .modal-icon, .success-icon, .error-icon {
        font-size: 3rem;
    }
    
    .progress-bar {
        height: 12px;
    }
    
    .airplane-progress {
        font-size: 1.1rem;
    }
}

/* Enhanced mobile interactions */
@media (max-width: 768px) {
    .input-group input:focus {
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(30, 136, 229, 0.2);
    }
    
    .login-btn:active {
        transform: scale(0.98);
    }
    
    .social-btn:active {
        transform: scale(0.95);
    }
    
    .login-form {
        animation: slideInUp 0.8s ease-out;
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.clicked {
    transform: scale(0.95) !important;
}

.touch-active {
    transform: scale(0.98) !important;
    opacity: 0.8 !important;
}

.input-group.focused input {
    border-color: #1e88e5;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}