* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    background: #ffffff;
    overflow: auto;
}

.login-container {
    display: grid;
    grid-template-columns: 55% 45%;
    width: 100%;
    height: 100vh;
}

.login-left {
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(15, 32, 39, 0.65) 0%,
            rgba(32, 58, 67, 0.55) 50%,
            rgba(44, 83, 100, 0.50) 100%);
    z-index: 1;
}

.background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 75% center;
}

.decorative-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 3;
}

.login-right {
    background: whitesmoke;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 60px;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.login-form-container {
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.logo-header {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.logo-image {
    max-width: 220px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.logo-container-small {
    background: #ffffff;
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.logo-container-small svg {
    width: 50px;
    height: 50px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    padding-bottom: 70px;
}

.company-name-small {
    color: #1a202c;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.company-tagline-small {
    color: #718096;
    font-size: 13px;
    font-weight: 400;
}

.login-header {
    margin-bottom: 35px;
}

.login-header h2 {
    font-size: 32px;
    color: #1a202c;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #718096;
    font-size: 15px;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 24px;
}


.form-group label {
    display: none !important;
}

.input-wrapper {
    position: relative;
}

.input-wrapper svg {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #a0aec0;
    transition: color 0.3s ease;
    pointer-events: none;
}

.input-wrapper input:focus+svg,
.input-wrapper:focus-within svg {
    color: #2c5364;
}

.form-group input,
.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 16px 18px 16px 52px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
    background: #f7fafc;
    color: #2d3748;
}

.form-group input:focus {
    border-color: #2c5364;
    background: white;
    box-shadow: 0 0 0 4px rgba(44, 83, 100, 0.08);
}

.form-group input::placeholder {
    color: #a0aec0;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    color: #4a5568;
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #2c5364;
}

.forgot-password {
    color: #2c5364;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #1e3c72;
}

.btn-login {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #2c5364 0%, #1e3c72 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(30, 60, 114, 0.25);
    letter-spacing: 0.5px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(30, 60, 114, 0.35);
}

.btn-login:active {
    transform: translateY(0);
}

.support-info {
    text-align: center;
    margin-top: 35px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #718096;
}

.support-info p {
    margin-bottom: 6px;
    line-height: 1.6;
}

.support-info strong {
    color: #2c5364;
    font-weight: 600;
}

.error-message {
    background-color: #fed7d7;
    color: #c53030;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #f56565;
}



@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
    }

    .login-left {
        display: none;
    }

    .login-right {
        padding: 50px 40px;
    }
}


@media (max-width: 768px) {
    body {
        min-height: 100vh;
        height: auto;
    }

    .login-container {
        height: auto;
        min-height: 100vh;
    }

    .login-right {
        padding: 20px 25px;
        align-items: center;
        justify-content: center;
    }

    .login-form-container {
        margin-top: 0;
        max-width: 100%;
    }


    .logo-header {
        margin-bottom: 24px;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .logo-image {
        max-width: 150px;
    }

    .logo-text {
        padding-bottom: 0;
        text-align: center;
    }

    .company-name-small {
        font-size: 18px;
    }

    .company-tagline-small {
        font-size: 12px;
    }

    
    .login-header {
        margin-bottom: 24px;
        text-align: center;
    }

    .login-header h2 {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .login-header p {
        font-size: 13px;
    }

   
    .form-group {
        margin-bottom: 16px;
    }

    .form-group input,
    .form-group input[type="text"],
    .form-group input[type="password"] {
        padding: 14px 14px 14px 48px;
        font-size: 16px; /* Evita zoom en iOS */
    }

    .btn-login {
        padding: 15px;
        font-size: 15px;
        margin-top: 10px;
    }

    .error-message {
        padding: 0.75rem;
        font-size: 13px;
        margin-bottom: 1rem;
        text-align: center;
    }
}


@media (max-width: 480px) {
    .login-right {
        padding: 15px 20px;
    }

    .logo-image {
        max-width: 130px;
    }

    .company-name-small {
        font-size: 17px;
    }

    .company-tagline-small {
        font-size: 11px;
    }

    .login-header h2 {
        font-size: 20px;
    }

    .login-header p {
        font-size: 12px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .btn-login {
        padding: 14px;
        font-size: 14px;
    }
}


@media (max-height: 700px) and (max-width: 768px) {
    .login-right {
        padding: 10px 20px;
    }

    .logo-image {
        max-width: 120px;
    }

    .logo-header {
        margin-bottom: 16px;
    }

    .login-header {
        margin-bottom: 16px;
    }

    .login-header h2 {
        font-size: 19px;
        margin-bottom: 6px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group input,
    .form-group input[type="text"],
    .form-group input[type="password"] {
        padding: 12px 12px 12px 45px;
    }

    .btn-login {
        padding: 13px;
        margin-top: 8px;
    }

    .error-message {
        padding: 0.6rem;
        margin-bottom: 0.8rem;
        font-size: 12px;
    }
}


#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    background: white;
    padding: 50px 60px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
    border: 5px solid #e2e8f0;
    border-top: 5px solid #2c5364;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h3 {
    color: #2c5364;
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.loading-content p {
    color: #718096;
    font-size: 15px;
    margin: 0;
}

@media (max-width: 480px) {
    .loading-content {
        padding: 35px 40px;
        margin: 0 20px;
    }

    .spinner {
        width: 50px;
        height: 50px;
    }

    .loading-content h3 {
        font-size: 20px;
    }

    .loading-content p {
        font-size: 14px;
    }
}