/* ========== AUTH LAYOUT (LOGIN ONLY) - COMPLETE REDESIGN ========== */
/* Modern, Professional, Fixed Layout for All Devices */

/* ========== BASE LAYOUT ========== */
.login-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a3a5c 0%, #2c5a90 50%, #4a7ba7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    z-index: 10000;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.login-page.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    z-index: -1 !important;
}

body:has(.portal-container.active) .login-page {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    z-index: -1 !important;
}

/* ========== MAIN CONTAINER ========== */
.login-container {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 1200px;
    display: flex;
    min-height: 600px;
    max-height: calc(100vh - 80px);
    box-sizing: border-box;
    overflow: visible;
    position: relative;
}

/* ========== LEFT SECTION (BRANDING) ========== */
.login-left {
    flex: 0 0 50%;
    background: linear-gradient(135deg, #1a3a5c 0%, #2c5a90 50%, #4a7ba7 100%);
    color: #ffffff;
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="50" height="50" patternUnits="userSpaceOnUse"><path d="M 50 0 L 0 0 0 50" fill="none" stroke="rgba(255,255,255,0.06)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

.login-left::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}

.eh-logo-container {
    margin-bottom: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.eh-logo-image {
    max-width: 220px;
    width: 100%;
    height: auto;
    max-height: 95px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    text-align: center;
    position: relative;
    z-index: 1;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 35px;
    text-align: center;
    position: relative;
    z-index: 1;
    font-weight: 400;
    line-height: 1.4;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    color: rgba(255, 255, 255, 0.95);
    padding: 14px;
    border-radius: 14px;
    transition: all 0.3s ease;
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #ffffff;
}

.feature-item h4 {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    line-height: 1.3;
}

.feature-item p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
    margin: 0;
}

/* ========== RIGHT SECTION (LOGIN FORM) ========== */
.login-right {
    flex: 0 0 50%;
    padding: 60px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: #ffffff;
    position: relative;
    overflow: visible;
    overflow-x: hidden;
    overflow-y: visible;
}

.login-form {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    overflow: visible;
    overflow-x: hidden;
    overflow-y: visible;
}

.login-form h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a3a5c;
    margin-bottom: 8px;
    text-align: center;
    position: relative;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.login-form h2::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #1a3a5c, #2c5a90);
    border-radius: 2px;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form .form-group:last-of-type {
    margin-bottom: 32px;
}

.login-form .form-group label {
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 10px;
    display: block;
    font-size: 14px;
    line-height: 1.4;
}

.login-form .input-with-icon {
    position: relative;
}

.login-form .input-with-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 1;
    font-size: 16px;
}

.login-form .input-with-icon .form-control {
    padding: 14px 16px 14px 48px;
    width: 100%;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 15px;
    background: #ffffff;
    color: #1a3a5c;
    box-sizing: border-box;
}

.login-form .input-with-icon .form-control:hover {
    border-color: #c0c8d0;
}

.login-form .input-with-icon .form-control:focus {
    border-color: #1a3a5c;
    outline: none;
    box-shadow: 0 0 0 4px rgba(26, 58, 92, 0.1);
    background: #ffffff;
}

.login-form select.form-control {
    padding: 14px 16px;
    padding-right: 45px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a3a5c' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    cursor: pointer;
}

.login-form .form-help-text {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

.login-form .btn-primary {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(26, 58, 92, 0.25);
    transition: all 0.3s ease;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a3a5c 0%, #2c5a90 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
}

.login-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 58, 92, 0.35);
    background: linear-gradient(135deg, #2c5a90 0%, #1a3a5c 100%);
}

.login-form .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(26, 58, 92, 0.25);
}

/* ========== NEW USER CONTACT (below login button) ========== */
.login-new-user-contact {
    margin-top: 20px;
    padding: 14px 16px;
    background: #f8f9fc;
    border-radius: 10px;
    border: 1px solid #e8ecf2;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
}

.login-new-user-heading {
    font-size: 12px;
    font-weight: 600;
    color: #5e6e7f;
    margin: 0 0 10px 0;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.login-contact-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 12px;
    font-size: 13px;
    line-height: 1.4;
}

.login-contact-item {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.login-contact-sep {
    color: #c8d0d8;
    font-weight: 700;
    font-size: 12px;
    user-select: none;
}

.login-contact-office {
    color: #6c757d;
    font-weight: 500;
    font-size: 12px;
}

.login-contact-phone {
    font-weight: 600;
    color: #1a3a5c;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.login-contact-phone:hover {
    color: #2c5a90;
    text-decoration: underline;
}

/* ========== DESKTOP LARGE (Above 1200px) ========== */
@media (min-width: 1201px) {
    .login-page {
        padding: 50px;
    }
    
    .login-container {
        max-height: calc(100vh - 100px);
    }
    
    .login-left {
        padding: 50px 45px;
    }
    
    .eh-logo-image {
        max-width: 220px;
        max-height: 95px;
    }
}

/* ========== TABLET RESPONSIVE (768px - 1024px) ========== */
@media (max-width: 1024px) and (min-width: 769px) {
    .login-page {
        padding: 30px 20px;
    }
    
    .login-container {
        max-height: calc(100vh - 60px);
    }
    
    .login-container {
        max-width: 900px;
        min-height: 550px;
    }
    
    .login-left {
        padding: 50px 40px;
    }
    
    .login-right {
        padding: 50px 40px;
    }
    
    .eh-logo-image {
        max-width: 240px;
        max-height: 100px;
    }
    
    .login-title {
        font-size: 28px;
    }
    
    .login-subtitle {
        font-size: 15px;
        margin-bottom: 40px;
    }
    
    .feature-list {
        max-width: 380px;
        gap: 16px;
    }
    
    .feature-item {
        padding: 16px;
    }
    
    .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .feature-item h4 {
        font-size: 15px;
    }
    
    .feature-item p {
        font-size: 12px;
    }
    
    .login-form h2 {
        font-size: 26px;
    }
}

/* ========== MOBILE RESPONSIVE (Below 768px) ========== */
@media (max-width: 768px) {
    .login-page {
        padding: 0;
        align-items: stretch;
    }
    
    .login-container {
        flex-direction: column;
        min-height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
        overflow: visible;
    }
    
    .login-left {
        flex: 0 0 auto;
        padding: 40px 25px 30px;
        min-height: auto;
        overflow: visible;
    }
    
    .eh-logo-image {
        max-width: 200px;
        max-height: 85px;
    }
    
    .login-title {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .login-subtitle {
        font-size: 14px;
        margin-bottom: 30px;
    }
    
    .feature-list {
        display: none; /* Hide features on mobile for cleaner look */
    }
    
    .login-right {
        flex: 1;
        padding: 35px 25px 40px;
        min-height: auto;
        overflow: visible !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }
    
    .login-form {
        max-width: 100%;
        overflow: visible !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }
    
    .login-form h2 {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .login-form h2::after {
        width: 50px;
        height: 3px;
        bottom: -15px;
    }
    
    .login-form .form-group {
        margin-bottom: 20px;
    }
    
    .login-form .form-group:last-of-type {
        margin-bottom: 28px;
    }
    
    .login-form .input-with-icon .form-control {
        padding: 13px 15px 13px 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .login-form .btn-primary {
        padding: 15px 22px;
        font-size: 16px;
    }
    
    .login-new-user-contact {
        margin-top: 18px;
        padding: 12px 14px;
    }
    
    .login-new-user-heading {
        font-size: 11px;
        margin-bottom: 8px;
    }
    
    .login-contact-list {
        font-size: 12px;
        gap: 4px 10px;
    }
    
    .login-contact-phone {
        font-size: 13px;
    }
}

/* ========== SMALL MOBILE (Below 480px) ========== */
@media (max-width: 480px) {
    .login-left {
        padding: 35px 20px 25px;
    }
    
    .eh-logo-image {
        max-width: 170px;
        max-height: 70px;
    }
    
    .login-title {
        font-size: 22px;
    }
    
    .login-subtitle {
        font-size: 13px;
        margin-bottom: 25px;
    }
    
    .login-right {
        padding: 30px 20px 35px;
    }
    
    .login-form h2 {
        font-size: 22px;
        margin-bottom: 25px;
    }
    
    .login-form .form-group {
        margin-bottom: 18px;
    }
    
    .login-form .form-group:last-of-type {
        margin-bottom: 24px;
    }
    
    .login-form .input-with-icon .form-control {
        padding: 12px 14px 12px 42px;
    }
    
    .login-new-user-contact {
        margin-top: 16px;
        padding: 10px 12px;
    }
    
    .login-new-user-heading {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .login-contact-list {
        flex-direction: column;
        gap: 6px;
        font-size: 12px;
    }
    
    .login-contact-sep {
        display: none;
    }
    
    .login-contact-item {
        display: flex;
        justify-content: center;
    }
}

/* ========== PREVENT HORIZONTAL SCROLLING ========== */
.login-page *,
.login-page *::before,
.login-page *::after {
    max-width: 100%;
    box-sizing: border-box;
}

.login-page {
    overflow-x: hidden !important;
}

.login-container,
.login-left,
.login-right,
.login-form,
.login-form * {
    overflow: visible !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.login-container::-webkit-scrollbar,
.login-left::-webkit-scrollbar,
.login-right::-webkit-scrollbar,
.login-form::-webkit-scrollbar,
.login-form *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
    .login-page *,
    .login-page *::before,
    .login-page *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
