:root {
    --primary-blue: #0043a9;
    --dark-text: #2c2a29;
    --gray-text: #5e6d77;
    --bg-gray: #f4f6f9;
    --btn-radius: 8px;
    --font-family: 'Roboto', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: #f2f4f7;
    /* Slightly darker to show shadow */
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === LOADING OVERLAY === */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e6e6e6;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    border: 5px solid #bdc3c7;
    border-top: 5px solid var(--primary-blue);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* === LAYOUT === */
/* === LAYOUT === */
.portal-container {
    display: flex;
    width: 990px;
    /* Exact requested width */
    height: auto;
    min-height: 500px;
    max-height: 90vh;
    background-color: #fff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

/* Left Column */
.login-section {
    width: 55%;
    /* More space for form */
    min-width: unset;
    /* Remove min-width constraint */
    padding: 30px 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
    border-right: 1px solid #f0f0f0;
}

.logo-area {
    margin-bottom: 30px;
}

.portal-logo {
    height: 40px;
}

.welcome-title {
    font-size: 24px;
    color: var(--dark-text);
    margin-bottom: 25px;
    font-weight: 700;
}

.security-banner {
    background-color: #003a8f;
    color: #fff;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    font-size: 13px;
}

.security-banner a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

.login-box {
    width: 100%;
    max-width: 400px;
}

.login-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--gray-text);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 500;
}

.tab-btn.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

.info-msg {
    background-color: #f0f7ff;
    padding: 15px;
    font-size: 12px;
    color: var(--gray-text);
    margin-top: 20px;
    border-radius: 4px;
    position: relative;
    border-left: 3px solid var(--primary-blue);
}

.info-msg p {
    margin: 0;
    padding-right: 20px;
}

.close-msg {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 14px;
    color: var(--gray-text);
    cursor: pointer;
}

.login-form {
    margin-top: 25px;
}

.login-form label {
    display: block;
    font-size: 13px;
    color: var(--gray-text);
    margin-bottom: 5px;
    font-weight: 500;
}

.mt-20 {
    margin-top: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.select-doc,
.input-doc,
.input-pass {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
}

.select-doc {
    width: 80px;
    background-color: #fff;
}

.input-doc {
    flex-grow: 1;
    min-width: 0;
    /* Prevent overflow particularly on mobile */
    box-sizing: border-box;
}

.input-wrapper {
    position: relative;
}

.input-pass {
    width: 100%;
    box-sizing: border-box;
}

.eye-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    /* opacity: 0.5; Removed to make the blue clearer */
    color: var(--primary-blue);
}

.btn-submit {
    width: 100%;
    background-color: #e0e0e0;
    color: #888;
    border: none;
    padding: 12px;
    border-radius: 20px;
    font-weight: 700;
    margin-top: 30px;
    cursor: not-allowed;
    transition: all 0.2s;
}

.btn-submit.active {
    background-color: var(--primary-blue);
    color: #fff;
    cursor: pointer;
}

.btn-submit:hover {
    background-color: #d6d6d6;
}

.btn-submit.active:hover {
    background-color: #003380;
}

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 14px;
}

.login-links a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.footer-legal {
    margin-top: auto;
    font-size: 10px;
    color: #999;
    padding-top: 40px;
}

.footer-legal a {
    color: var(--primary-blue);
    text-decoration: none;
}

/* Right Column */
/* Right Column */
.promo-section {
    width: 45%;
    flex-grow: unset;
    background-color: #f7f9fb;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    border-left: 1px solid #eee;
}

.promo-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    max-width: 600px;
    align-self: center;
    width: 100%;
}

.promo-content {
    position: relative;
    height: 300px;
}

.promo-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.promo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9) 30%, rgba(255, 255, 255, 0) 100%);
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.tag {
    font-size: 10px;
    font-weight: 900;
    color: #000;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.promo-overlay h3 {
    margin: 0 0 20px 0;
    font-size: 22px;
    max-width: 250px;
    color: var(--dark-text);
}

.btn-promo {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.quick-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Space out for slider look */
    gap: 10px;
}

.slider-nav {
    width: 32px;
    height: 32px;
    border: 2px solid var(--primary-blue);
    border-radius: 10px;
    /* Semi-square like screenshot */
    background: #fff;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.slider-nav:hover {
    background-color: var(--primary-blue);
    color: #fff;
}

.q-link {
    background: white;
    border: 1px solid #dae1e7;
    padding: 15px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary-blue);
    font-size: 14px;
    /* Updated to match screenshot */
    font-weight: 500;
    /* Roboto Medium */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100px;
    /* Adjusted width */
    height: 100px;
    /* Adjusted height */
    text-align: center;
    justify-content: center;
    transition: box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    line-height: 1.2;
}

.q-link:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--primary-blue);
}

.q-link i {
    font-size: 24px;
    margin-bottom: 5px;
}

.arrow-link {
    width: 40px;
    justify-content: center;
}

.version-tag {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 11px;
    color: #ccc;
    transform: rotate(-90deg);
    transform-origin: right bottom;
}

@media (max-width: 768px) {
    body {
        align-items: flex-start;
        height: auto;
        min-height: 100vh;
        padding: 20px 0;
    }

    .portal-container {
        flex-direction: column;
        width: 90%;
        max-width: 400px;
        height: auto;
        min-height: auto;
        margin: 20px auto;
    }

    .login-section {
        width: 100%;
        min-width: auto;
        padding: 30px;
        height: auto;
        border-right: none;
    }

    .promo-section {
        display: none;
    }
}

/* === PORTAL EMPRESAS SPECIFIC === */
.portal-container.empresas-container {
    padding: 0;
    max-width: 1000px;
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    margin: 40px auto 80px;
}

.login-section.empresas-text-section {
    width: 45%;
    background: transparent;
    border: none;
    padding: 0 0 0 40px;
}

.welcome-title-empresas {
    font-size: 32px;
    font-weight: 700;
    color: #2c2a29;
    margin-bottom: 20px;
    line-height: 1.2;
}

.welcome-desc-empresas {
    font-size: 16px;
    color: #5e6d77;
    line-height: 1.6;
}

.promo-section.login-card-section {
    width: 45%;
    background: transparent;
    border: none;
    padding: 0 40px 0 0;
    display: block;
}

.login-card-empresas {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    color: #2c2a29;
    font-weight: 500;
}

.card-body {
    padding: 30px;
}

.login-form-empresas label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #5e6d77;
    margin-bottom: 8px;
}

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

.select-doc-empresas {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ccc;
    /* Matches screenshot gray border */
    border-radius: 8px;
    font-size: 15px;
    color: #5e6d77;
    background-color: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230043a9%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
    cursor: pointer;
}

.btn-submit-empresas {
    width: 100%;
    padding: 14px;
    background-color: #0043a9;
    color: white;
    font-weight: 700;
    font-size: 15px;
    border: none;
    border-radius: 25px;
    /* Fully rounded pill */
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-submit-empresas.disabled {
    background-color: #e6e6e6;
    color: #999;
    cursor: default;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .portal-container.empresas-container {
        flex-direction: column;
        gap: 30px;
        padding: 0 20px;
    }

    .login-section.empresas-text-section,
    .promo-section.login-card-section {
        width: 100%;
        padding: 0;
        text-align: center;
    }

    .promo-section.login-card-section {
        display: block;
        /* Override default hide on mobile */
    }
}

/* === EMPRESAS LAYOUT CORRECTIONS === */
body.empresas-layout {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: auto;
    min-height: 100vh;
    background-color: #f4f6f9;
    align-items: stretch;
}

body.empresas-layout header {
    background-color: #000000 !important;
    /* Force black background as requested */
    flex-shrink: 0;
}

body.empresas-layout .portal-container.empresas-container {
    flex-grow: 1;
    margin: 40px auto;
}

body.empresas-layout footer {
    flex-shrink: 0;
}

/* === EMPRESAS FORM INPUTS === */
.doc-row-empresas {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: flex-end;
}

.doc-col-large {
    flex: 1;
}

.doc-col-small {
    width: 60px;
}

.login-form-empresas label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #5e6d77;
    margin-bottom: 8px;
}

.input-empresas {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ccc;
    /* Match screenshot border */
    border-radius: 8px;
    font-size: 15px;
    color: #2c2a29;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.input-empresas:focus {
    border-color: #0043a9;
}

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

/* Responsive adjustments for the row */
@media (max-width: 480px) {
    .doc-row-empresas {
        gap: 10px;
    }
}