* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    min-height: 100vh;
    background-color: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    transition: background-color 0.5s ease;
}

body.theme-solar {
    background: linear-gradient(145deg, #f0f5fa 0%, #e1e9f0 100%);
}

body.theme-aslaf {
    background: linear-gradient(145deg, #f5efe6 0%, #e8ddcf 100%);
}

.login-container {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 40px;
    box-shadow: 0 30px 60px rgba(0, 20, 30, 0.2);
    display: flex;
    overflow: hidden;
    animation: fadeIn 0.6s ease;
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.empresa-panel {
    width: 380px;
    background: #1D3B4F;
    padding: 40px 30px;
    color: white;
    display: flex;
    flex-direction: column;
    transition: background 0.5s ease, transform 0.3s ease;
}

.empresa-panel.solar {
    background: #1D3B4F;
}

.empresa-panel.aslaf {
    background: #8D7442;
}

.panel-header {
    margin-bottom: 40px;
}

.panel-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.panel-header p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.5;
}

.empresas-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.empresa-item {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    color: white;
    text-align: left;
}

.empresa-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.empresa-item.selected {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.empresa-logo-small {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.empresa-info-small {
    flex: 1;
}

.empresa-info-small h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.empresa-info-small p {
    font-size: 12px;
    opacity: 0.7;
}

.empresa-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.panel-footer {
    font-size: 12px;
    opacity: 0.6;
    text-align: center;
}

.login-panel {
    flex: 1;
    padding: 60px 50px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.mobile-menu-toggle {
    display: none;
    position: absolute;
    top: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background: #f0f6fc;
    border: none;
    border-radius: 50%;
    color: #1D3B4F;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: #1D3B4F;
    color: white;
}

.mobile-close-btn {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 20;
}

.mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.empresa-seleccionada {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f5fa;
}

.empresa-logo-large {
    width: 280px;
    height: 100px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.empresa-logo-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: #1D3B4F;
    margin-bottom: 10px;
    text-align: center;
}

.form-subtitle {
    color: #7F9FB5;
    font-size: 15px;
    margin-bottom: 30px;
    word-break: break-word;
    text-align: center;
}

.input-group {
    margin-bottom: 25px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1D4E6B;
    margin-bottom: 8px;
}

.input-field {
    position: relative;
}

.input-field>i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #9FBFD9;
    font-size: 18px;
    transition: color 0.3s ease;
}

.input-field input {
    width: 100%;
    padding: 18px 56px 18px 52px;
    border: 2px solid #E8F0F5;
    border-radius: 20px;
    font-size: 16px;
    color: #1D3B4F;
    background: #F9FCFE;
    transition: all 0.3s ease;
}

.input-field input:focus {
    outline: none;
    border-color: #1D4E6B;
    background: white;
    box-shadow: 0 5px 15px rgba(29, 78, 107, 0.1);
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9FBFD9;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2;
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
}

.toggle-password:hover {
    color: #1D4E6B;
}

.btn-login {
    width: 100%;
    padding: 18px;
    background: #1D3B4F;
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(29, 59, 79, 0.2);
    margin-bottom: 20px;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(29, 59, 79, 0.3);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-message {
    background: #fee9e7;
    border: 1px solid #f5a29d;
    border-radius: 16px;
    padding: 15px 20px;
    color: #b33c3c;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 0;
    margin-bottom: 20px;
    animation: shake 0.3s ease;
}

.error-message.is-hidden {
    display: none;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.separator {
    text-align: center;
    margin: 20px 0;
    color: #9FBFD9;
    font-size: 13px;
    position: relative;
}

.separator::before,
.separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #E8F0F5;
}

.separator::before {
    left: 0;
}

.separator::after {
    right: 0;
}

.support-link {
    text-align: center;
    color: #7F9FB5;
    font-size: 13px;
}

.support-link a {
    color: #1D4E6B;
    text-decoration: none;
    font-weight: 500;
}

.support-link a:hover {
    text-decoration: underline;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

@media screen and (max-width: 1024px) {
    .login-container {
        border-radius: 35px;
    }

    .empresa-panel {
        width: 320px;
        padding: 30px 25px;
    }

    .login-panel {
        padding: 40px 35px;
    }

    .empresa-logo-large {
        width: 250px;
        height: 110px;
    }

    .form-title {
        font-size: 26px;
    }
}

@media screen and (max-width: 768px) {
    body {
        padding: 12px;
    }

    .login-container {
        position: relative;
        max-width: 480px;
        border-radius: 30px;
        min-height: auto;
    }

    .empresa-panel {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        border-radius: 0 30px 30px 0;
        padding: 50px 25px;
        z-index: 100;
        transition: left 0.3s ease;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.2);
    }

    .empresa-panel.mobile-open {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-close-btn {
        display: flex;
    }

    .mobile-overlay {
        display: none;
    }

    .mobile-overlay.active {
        display: block;
    }

    .login-panel {
        padding: 60px 25px 30px;
        width: 100%;
    }

    .empresa-seleccionada {
        margin-bottom: 40px;
        padding-bottom: 25px;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .empresa-logo-large {
        width: 250px;
        height: 100px;
    }

    .form-title {
        font-size: 24px;
    }

    .form-subtitle {
        font-size: 14px;
        margin-bottom: 25px;
    }

    .input-field input {
        padding: 16px 50px 16px 48px;
        font-size: 15px;
    }

    .btn-login {
        padding: 16px;
        font-size: 17px;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 8px;
    }

    .login-container {
        border-radius: 24px;
    }

    .empresa-panel {
        padding: 40px 20px;
    }

    .panel-header h2 {
        font-size: 20px;
    }

    .panel-header p {
        font-size: 12px;
    }

    .empresa-item {
        padding: 15px;
        gap: 12px;
    }

    .empresa-logo-small {
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 14px;
    }

    .empresa-info-small h3 {
        font-size: 14px;
    }

    .login-panel {
        padding: 50px 20px 25px;
    }

    .empresa-seleccionada {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .empresa-logo-large {
        width: 200px;
        height: 90px;
    }

    .form-title {
        font-size: 22px;
    }

    .form-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .input-group {
        margin-bottom: 20px;
    }

    .input-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .input-field>i {
        left: 15px;
        font-size: 16px;
    }

    .input-field input {
        padding: 14px 46px 14px 45px;
        font-size: 14px;
        border-radius: 16px;
        border-width: 1.5px;
    }

    .btn-login {
        padding: 14px;
        font-size: 16px;
        border-radius: 16px;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
        top: 15px;
        left: 15px;
    }
}