/* Medical-themed Login Styles */
:root {
    --login-accent: #2563eb;
    --login-accent-2: #38bdf8;
    --login-ink: #0b1f33;
    --login-muted: #5b6f86;
    --login-surface: #ffffff;
    --login-border: #dbe4f0;
    --login-sidebar-blue: #0e2b4d;
    --login-sidebar-blue-2: #15457a;
    --login-sidebar-blue-3: #1c6eaf;
}
.login-body { 
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 56px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 56px),
        linear-gradient(160deg, #0b1b2c 0%, #0c2033 55%, #0f2a45 100%);
    background-attachment: fixed;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    display: block;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 769px) {
    .login-body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Medical-themed tiled gradient background */
.login-body::before {
    content: '';
    position: fixed;
    inset: 0;
    /* subtle medical gradient tint */
    background:
        radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.18), transparent 45%),
        radial-gradient(circle at 90% 0%, rgba(59, 130, 246, 0.18), transparent 42%),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.12) 0 1px, transparent 1px 56px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0 1px, transparent 1px 56px);
    mix-blend-mode: screen;
    pointer-events: none;
}

.login-body::after {
    content: '';
    position: fixed;
    inset: 0;
    /* random mosaic: 5 medical-themed colors scattered across entire background */
    background:
        radial-gradient(circle at 20% 80%, rgba(56, 189, 248, 0.12), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.12), transparent 42%),
        radial-gradient(circle at 70% 20%, rgba(14, 165, 233, 0.15), transparent 38%);
    pointer-events: none;
}

.login-container { 
    display: block; 
    min-height: 100vh;
    width: 100%;
    padding: 0; 
    position: relative;
    margin: 0;
    box-sizing: border-box;
    overflow: visible;
}

/* Normal/Desktop mode - perfect centering without scroll */
@media (min-width: 769px) {
    .login-container {
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: none !important;
    }
}

/* remove old dotted overlay for cleaner tiled look */
.login-container::before { display: none; }

.login-card { 
    width: 100%; 
    max-width: 400px; 
    background: rgba(255, 255, 255, 0.96); 
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8); 
    border-radius: 18px; 
    padding: 24px; 
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow-y: auto;
    margin: 0;
    flex-shrink: 0;
    animation: loginCardReveal 0.6s ease-out;
}

@keyframes loginCardReveal {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card--split {
    max-width: 780px;
    padding: 0;
    display: grid;
    grid-template-columns: 1.05fr 0.85fr;
    overflow: hidden;
}

.login-panel {
    padding: 22px;
    display: flex;
    flex-direction: column;
}

.login-panel--form {
    background:
        radial-gradient(circle at 12% 12%, rgba(96, 165, 250, 0.18), transparent 30%),
        radial-gradient(circle at 90% 90%, rgba(56, 189, 248, 0.16), transparent 34%),
        linear-gradient(170deg, var(--login-sidebar-blue) 0%, var(--login-sidebar-blue-2) 54%, var(--login-sidebar-blue-3) 100%);
    animation: panelRise 0.5s ease-out;
    color: #f8fbff;
}

@keyframes panelRise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Normal/Desktop mode - no scroll needed, perfectly sized and centered */
@media (min-width: 769px) {
    .login-card {
        max-height: none !important;
        overflow-y: visible !important;
        padding: 22px !important;
        margin: 0 !important;
        position: relative !important;
        width: 100% !important;
        max-width: 360px !important;
    }

    .login-card--split {
        max-width: 780px !important;
        padding: 0 !important;
        grid-template-columns: 1.05fr 0.85fr;
    }

    .login-card--split .login-panel {
        padding: 22px !important;
    }
}

@media (max-width: 900px) {
    .login-card--split {
        grid-template-columns: 1fr;
    }
}

.login-header { 
    text-align: left; 
    margin-bottom: 12px; 
}

.login-error-summary {
    margin-bottom: 16px;
}

.login-header .logo { 
    display: flex; 
    align-items: center; 
    justify-content: flex-start; 
    gap: 12px; 
    font-weight: 700; 
    font-size: 22px; 
    color: #ffffff;
    margin-bottom: 8px;
}

.logo-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
    border-radius: 12px;
    color: white;
    font-size: 20px;
}

/* Custom Heartbeat Logo */
.heartbeat-logo {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heart {
    position: relative;
    width: 20px;
    height: 18px;
    background: white;
    border-radius: 10px 10px 0 0;
    transform: rotate(-45deg);
    animation: heartbeat 1.5s ease-in-out infinite;
}

.heart:before,
.heart:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 18px;
    background: white;
    border-radius: 10px 10px 0 0;
}

.heart:before {
    top: -9px;
    left: 0;
    transform: rotate(90deg);
}

.heart:after {
    top: 0;
    left: 9px;
    transform: rotate(90deg);
}

.ecg-line {
    position: absolute;
    top: 50%;
    left: -8px;
    right: -8px;
    height: 2px;
    background: white;
    transform: translateY(-50%);
    z-index: 2;
}

.ecg-line:before {
    content: '';
    position: absolute;
    top: -3px;
    left: 2px;
    width: 2px;
    height: 8px;
    background: white;
}

.ecg-line:after {
    content: '';
    position: absolute;
    top: -6px;
    left: 6px;
    width: 2px;
    height: 14px;
    background: white;
}

@keyframes heartbeat {
    0% { transform: rotate(-45deg) scale(1); }
    25% { transform: rotate(-45deg) scale(1.1); }
    50% { transform: rotate(-45deg) scale(1); }
    75% { transform: rotate(-45deg) scale(1.05); }
    100% { transform: rotate(-45deg) scale(1); }
}

.pulse-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.1); opacity: 0; }
}

.login-header h1 { 
    margin: 0 0 6px; 
    font-size: 26px; 
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.login-header p { 
    margin: 0; 
    color: rgba(239, 246, 255, 0.82); 
    font-size: 14px;
    line-height: 1.6;
}

.login-form .form-group { 
    margin-bottom: 12px; 
}

.caps-lock-warning {
    margin-top: 8px;
    font-size: 12px;
    color: #b45309;
    display: flex;
    align-items: center;
    gap: 6px;
}

.privacy-note {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(239, 246, 255, 0.82);
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
}

.privacy-note i {
    color: #bfdbfe;
}

.medical-input-group { 
    position: relative;
    display: flex; 
    align-items: center; 
    border-radius: 12px; 
    background: rgba(255, 255, 255, 0.96);
    border: 1.5px solid rgba(191, 219, 254, 0.42);
    transition: all 0.3s ease;
    overflow: hidden;
}

.medical-input-group:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.2);
}

.medical-input-group.input-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.medical-icon { 
    color: #1d4ed8; 
    padding: 16px 12px 16px 16px;
    font-size: 17px;
    background: rgba(219, 234, 254, 0.9);
    border-right: 1px solid rgba(191, 219, 254, 0.7);
}

.medical-input-group input { 
    border: none; 
    outline: none; 
    width: 100%; 
    font-size: 15px; 
    padding: 12px 16px;
    background: transparent;
    color: #2d3748;
}

.medical-input-group input::placeholder {
    color: #7b8ea5;
}

.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #2563eb;
}

.btn-medical {
    background: linear-gradient(135deg, #1d4ed8, #0f3e7b);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 10px 24px rgba(9, 30, 66, 0.28);
}

.btn-medical:hover {
    background: linear-gradient(135deg, #2563eb, #15457a);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(9, 30, 66, 0.34);
}

.btn-medical:active {
    transform: translateY(0);
}

.btn-full { 
    width: 100%; 
}

/* Form Labels */
.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #dbeafe;
    margin-bottom: 6px;
}

/* Checkbox Styling */
.form-options {
    margin-top: 2px;
    margin-bottom: 12px;
    width: fit-content;
    align-self: flex-start;
}

.login-form .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #e0efff;
    padding: 0;
    border: none;
    background: transparent;
}

.login-panel--form .checkbox-text {
    color: rgba(239, 246, 255, 0.86);
}

.login-panel--form .checkmark {
    border-color: rgba(191, 219, 254, 0.8);
    background: rgba(255, 255, 255, 0.12);
}

.login-panel--form .login-form-links a {
    color: #ffffff;
}

.login-panel--form .login-form-links a:hover {
    color: #dbeafe;
}

.login-panel--form .brand-logo-image {
    border-radius: 50%;
    padding: 4px;
}

.login-panel--form .alert-error {
    background: rgba(254, 242, 242, 0.95);
    color: #991b1b;
    border-color: rgba(254, 202, 202, 0.95);
}

.login-form .checkbox-label:hover {
    background: transparent;
    border: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Alert Styling */
.alert {
    padding: 10px 12px;
    border-radius: 10px;
    margin: 8px 0 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    flex-shrink: 0;
}

.alert-error {
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    color: #742a2a;
    border-left: 4px solid #e53e3e;
}

.alert-success {
    background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
    color: #22543d;
    border-left: 4px solid #38a169;
}

/* Links */
.login-form a {
    color: var(--login-accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.login-form a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Links container */
.login-form-links {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.login-form-links-separator {
    color: #9ca3af;
}

/* Responsive Design */
/* Tablet and Mobile - allow scrolling if needed */
@media (max-width: 768px) {
    .login-body {
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
        height: auto;
        min-height: 100vh;
    }
    
    .login-container {
        padding: 20px;
        position: relative;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    
    .login-card {
        padding: 24px;
        max-width: 450px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .login-header h1 {
        font-size: 26px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .login-body {
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
        height: auto;
        min-height: 100vh;
    }
    
    .login-container {
        padding: 12px;
        position: relative;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    
    .login-card {
        padding: 20px;
        max-width: 100%;
        border-radius: 12px;
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .login-header {
        margin-bottom: 20px;
    }
    
    .login-header h1 {
        font-size: 22px;
        margin-bottom: 6px;
    }
    
    .login-header p {
        font-size: 14px;
    }
    
    .login-header .logo {
        font-size: 18px;
        gap: 10px;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .heartbeat-logo {
        width: 20px;
        height: 20px;
    }
    
    .heart {
        width: 16px;
        height: 14px;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .medical-input-group {
        border-radius: 10px;
        border-width: 1.5px;
    }
    
    .medical-icon {
        padding: 14px 12px 14px 16px;
        font-size: 15px;
    }
    
    .medical-input-group input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 14px 16px;
        min-height: 44px; /* Touch-friendly minimum size */
    }
    
    .password-toggle {
        right: 12px;
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-medical {
        padding: 16px 22px;
        font-size: 17px;
        border-radius: 10px;
        min-height: 44px; /* Touch-friendly minimum size */
    }
    
    .checkbox-label {
        font-size: 13px;
        gap: 10px;
    }
    
    .checkmark {
        width: 18px;
        height: 18px;
    }
    
    .alert {
        padding: 10px 12px;
        margin: 12px 0;
        font-size: 12px;
        gap: 8px;
    }
    
    .login-form-links {
        gap: 12px;
        font-size: 13px;
    }
    
    .login-form-links a {
        font-size: 13px;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .login-container {
        padding: 8px;
    }
    
    .login-card {
        padding: 16px;
    }
    
    .login-header h1 {
        font-size: 20px;
    }
    
    .login-header .logo {
        font-size: 16px;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .medical-input-group input {
        font-size: 14px;
        padding: 12px 14px;
    }
    
    .btn-medical {
        padding: 12px 18px;
        font-size: 14px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .login-container {
        align-items: flex-start;
        padding: 16px;
        padding-top: 20px;
    }
    
    .login-card {
        margin-top: 0;
        max-width: 500px;
    }
    
    .login-header {
        margin-bottom: 16px;
    }
    
    .login-header h1 {
        font-size: 22px;
        margin-bottom: 4px;
    }
    
    .login-header p {
        font-size: 13px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
}

@media (max-height: 600px) {
    .login-container {
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .login-card {
        margin-top: 20px;
    }
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal .modal-content {
        width: 95%;
        max-width: 500px;
        margin: 10px;
    }
    
    .modal .modal-header {
        padding: 10px 14px;
    }
    
    .modal .modal-body {
        padding: 14px;
    }
    
}

@media (max-width: 480px) {
    .modal .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .modal .modal-header {
        padding: 12px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .modal .modal-body {
        padding: 12px;
    }
    
}

/* Modal basics (shared look) */
.modal { 
    position: fixed; 
    inset: 0; 
    background: rgba(0, 0, 0, 0.35); 
    display: none; 
    align-items: center; 
    justify-content: center; 
    z-index: 1000; 
}

.modal.show {
    display: flex;
}

.modal .modal-content { 
    background: #fff; 
    border-radius: 12px; 
    border: 1px solid #e5e7eb; 
    padding: 0 0 12px; 
    width: 95%; 
    max-width: 560px; 
    max-height: 90vh;
    overflow-y: auto;
}

.modal .modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 16px; 
    border-bottom: 1px solid #e5e7eb; 
}

.modal .modal-body { 
    padding: 16px; 
}

.modal .close { 
    background: none; 
    border: none; 
    font-size: 22px; 
    line-height: 1; 
    cursor: pointer; 
    color: #6b7280; 
    transition: color 0.2s ease;
}

.modal .close:hover {
    color: #374151;
}

.modal .close,
.modal .modal-close,
.modal [data-modal-close],
.modal .close-modal-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    border: 1px solid #d8e3ef !important;
    background: #ffffff !important;
    color: #475569 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    text-decoration: none !important;
    appearance: none !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}

.modal .close:hover,
.modal .modal-close:hover,
.modal [data-modal-close]:hover,
.modal .close-modal-btn:hover {
    background: #f8fbff !important;
    border-color: #c7d5e6 !important;
    color: #0f172a !important;
    transform: translateY(-1px) !important;
}

.modal .close:focus-visible,
.modal .modal-close:focus-visible,
.modal [data-modal-close]:focus-visible,
.modal .close-modal-btn:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.18) !important;
    outline-offset: 2px !important;
}

.modal .close i,
.modal .modal-close i,
.modal [data-modal-close] i,
.modal .close-modal-btn i {
    pointer-events: none;
    font-size: 18px;
    line-height: 1;
}

/* Theme polish for login and account access pages */
:root {
    --auth-text: #0f2744;
    --auth-text-muted: #4f647b;
    --auth-primary: #1d4ed8;
    --auth-primary-strong: #1e3a8a;
    --auth-border: #c8d7e8;
    --auth-focus: rgba(29, 78, 216, 0.22);
}

.login-card {
    color: var(--auth-text);
    border-color: rgba(207, 222, 238, 0.85);
    box-shadow: 0 18px 34px rgba(8, 35, 72, 0.24);
}

.login-header h1,
.login-header .logo,
.form-group label {
    color: var(--auth-text);
}

.login-header p,
.checkbox-label,
.checkbox-text,
.login-form-links-separator {
    color: var(--auth-text-muted);
}

.medical-input-group {
    border-color: var(--auth-border);
    background: #fbfdff;
}

.medical-input-group:focus-within {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-focus);
}

.medical-icon {
    color: #2f5f95;
    background: #eef4fb;
    border-right-color: var(--auth-border);
}

.medical-input-group input {
    color: var(--auth-text);
}

/* Final split-login contrast overrides */
.login-card--split .login-panel--form,
.login-card--split .login-panel--form .login-header h1,
.login-card--split .login-panel--form .login-header .logo,
.login-card--split .login-panel--form .form-group label {
    color: #f8fbff;
}

.login-card--split .login-panel--form .login-header p,
.login-card--split .login-panel--form .checkbox-label,
.login-card--split .login-panel--form .checkbox-text,
.login-card--split .login-panel--form .privacy-note,
.login-card--split .login-panel--form .login-form-links-separator {
    color: rgba(239, 246, 255, 0.86);
}

.login-card--split .login-panel--form .login-form-links a {
    color: #ffffff;
}

.login-card--split .login-panel--form .login-form-links a:hover {
    color: #dbeafe;
}

.login-card--split .login-panel--form .logo-image-brand span {
    color: #ffffff;
    position: relative;
    top: -2px;
}

/* Portal login redesign */
.login-body {
    overflow: auto;
    position: relative;
}

.login-container {
    position: relative;
    min-height: 100vh;
    height: auto;
    width: 100%;
    padding: 0;
    overflow: visible;
}

.portal-login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}

.portal-showcase {
    position: relative;
    padding: 34px 48px 40px;
    background:
        repeating-linear-gradient(0deg, rgba(114, 147, 196, 0.13) 0 1px, transparent 1px 40px),
        repeating-linear-gradient(90deg, rgba(114, 147, 196, 0.13) 0 1px, transparent 1px 40px),
        linear-gradient(180deg, #132f5f 0%, #10274e 100%);
    color: #f8fbff;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: visible;
    min-height: 100vh;
}

.portal-showcase::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.18), transparent 30%),
        radial-gradient(circle at 85% 85%, rgba(37, 99, 235, 0.15), transparent 34%);
    pointer-events: none;
}

.portal-brand,
.portal-visual-card,
.portal-story-copy,
.portal-feature-list {
    position: relative;
    z-index: 1;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.portal-brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(52, 118, 255, 0.92), rgba(33, 171, 245, 0.85));
    box-shadow: 0 16px 28px rgba(8, 20, 38, 0.32);
}

.portal-brand-image {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.portal-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.portal-brand-name {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.portal-brand-subtitle {
    color: rgba(209, 227, 255, 0.78);
    font-size: 0.84rem;
}

.portal-visual-card {
    padding: 22px;
    min-height: 0;
    border-radius: 22px;
    border: 1px solid rgba(120, 156, 208, 0.28);
    background:
        linear-gradient(165deg, rgba(17, 37, 70, 0.75), rgba(14, 29, 55, 0.94)),
        linear-gradient(145deg, rgba(40, 84, 152, 0.24), rgba(25, 160, 228, 0.14));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

.portal-visual-grid {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 14% 18%, rgba(37, 99, 235, 0.28), transparent 18%),
        radial-gradient(circle at 82% 28%, rgba(56, 189, 248, 0.22), transparent 18%),
        radial-gradient(circle at 74% 76%, rgba(37, 99, 235, 0.18), transparent 24%);
    pointer-events: none;
}

.portal-visual-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 520px;
}

.portal-visual-badge {
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(93, 172, 255, 0.38);
    background: rgba(26, 77, 150, 0.32);
    color: #cfe6ff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portal-visual-card h2 {
    margin: 0;
    max-width: 660px;
    font-size: clamp(1.9rem, 3vw, 2.85rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    color: #ffffff;
}

.portal-visual-card p {
    margin: 0;
    max-width: 600px;
    font-size: 0.92rem;
    line-height: 1.62;
    color: rgba(219, 234, 254, 0.82);
}

.portal-visual-metrics {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-metric-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(11, 30, 57, 0.82);
    border: 1px solid rgba(110, 151, 206, 0.2);
    color: #dbeafe;
    font-size: 0.86rem;
    font-weight: 600;
}

.portal-story-copy h3 {
    margin: 0 0 10px;
    font-size: 1.34rem;
    line-height: 1.2;
    color: #ffffff;
}

.portal-story-copy p {
    margin: 0;
    max-width: 620px;
    color: rgba(214, 232, 255, 0.8);
    line-height: 1.6;
    font-size: 0.95rem;
}

.portal-feature-list {
    display: grid;
    gap: 12px;
}

.portal-feature-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 13px 14px;
    border-radius: 18px;
    background: rgba(9, 24, 48, 0.48);
    border: 1px solid rgba(114, 147, 196, 0.18);
}

.portal-feature-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(36, 91, 184, 0.95), rgba(20, 148, 219, 0.68));
    color: #eff6ff;
    font-size: 0.95rem;
}

.portal-feature-item strong {
    display: block;
    margin-bottom: 6px;
    color: #ffffff;
    font-size: 0.94rem;
}

.portal-feature-item p {
    margin: 0;
    color: rgba(214, 232, 255, 0.78);
    line-height: 1.5;
    font-size: 0.88rem;
}

.portal-access-panel {
    padding: 34px 48px 40px;
    background: linear-gradient(180deg, #0d1a30 0%, #0b172a 100%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: visible;
    min-height: 100vh;
}

.portal-access-card {
    width: min(100%, 500px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    color: #eff6ff;
    padding-top: 56px;
}

.portal-access-pill {
    width: fit-content;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(58, 123, 228, 0.58);
    background: rgba(20, 51, 102, 0.34);
    color: #8fc7ff;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portal-access-header h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.04;
    letter-spacing: -0.05em;
    color: #ffffff;
}

.portal-access-header p {
    margin: 8px 0 0;
    color: rgba(193, 212, 238, 0.8);
    line-height: 1.55;
    font-size: 0.94rem;
}

.portal-auth-panel {
    display: block;
}

.portal-login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.portal-login-form .form-group {
    margin-bottom: 0;
}

.portal-login-form label {
    display: block;
    margin-bottom: 8px;
    color: #f8fbff;
    font-size: 0.92rem;
    font-weight: 700;
}

.portal-input-group {
    min-height: 58px;
    border-radius: 16px;
    border: 1px solid rgba(82, 107, 149, 0.44);
    background: rgba(21, 32, 52, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.portal-input-group input {
    color: #f8fbff;
    font-size: 0.96rem;
}

.portal-input-group input::placeholder {
    color: rgba(161, 184, 216, 0.68);
}

.portal-input-group .medical-icon,
.portal-input-group .password-toggle {
    color: rgba(170, 193, 224, 0.72);
}

.portal-input-group .medical-icon {
    width: 54px;
    min-width: 54px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border-right: none;
    font-size: 1rem;
}

.portal-input-group .password-toggle {
    right: 12px;
    padding: 6px;
}

.portal-form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: -2px;
}

.portal-form-meta .checkbox-label {
    margin: 0;
}

.portal-form-meta .checkbox-text,
.portal-form-meta .field-link {
    color: rgba(193, 212, 238, 0.84);
}

.portal-form-meta .field-link:hover {
    color: #60a5fa;
}

.portal-submit-btn {
    min-height: 58px;
    border-radius: 18px;
    margin-top: 4px;
    background: linear-gradient(90deg, #2563eb 0%, #1ea5f2 100%);
    box-shadow: 0 18px 28px rgba(29, 78, 216, 0.24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 700;
}

.portal-security-note {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 16px;
    border: 1px solid rgba(73, 103, 146, 0.28);
    background: rgba(15, 27, 45, 0.84);
    color: rgba(193, 212, 238, 0.84);
    line-height: 1.55;
    font-size: 0.92rem;
}

.portal-security-note i {
    color: #60a5fa;
}

@media (max-height: 900px) and (min-width: 769px) {
    .portal-showcase {
        padding: 22px 24px 18px;
        gap: 16px;
    }

    .portal-access-panel {
        padding: 20px 22px;
    }

    .portal-visual-card h2 {
        font-size: clamp(1.75rem, 2.5vw, 2.4rem);
    }
}

@media (max-width: 1180px) {
    .portal-login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
        max-height: none;
    }

    .portal-showcase {
        order: 2;
    }

    .portal-access-panel {
        order: 1;
    }

    .portal-showcase,
    .portal-access-panel {
        padding: 24px;
        min-height: auto;
    }
}

@media (max-width: 920px) {
    .login-body {
        height: auto;
        min-height: 100vh;
    }

    .login-container {
        min-height: 100vh;
        padding: 0;
    }

    .portal-login-shell {
        width: 100%;
    }

    .portal-showcase {
        gap: 16px;
        max-height: none;
    }

    .portal-access-card {
        width: 100%;
        max-width: 560px;
        padding-top: 0;
    }

    .portal-visual-card {
        padding: 20px;
    }

    .portal-feature-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 0;
    }

    .portal-login-shell {
        min-height: auto;
    }

    .portal-showcase,
    .portal-access-panel {
        padding: 18px;
    }

    .portal-brand {
        align-items: center;
        gap: 12px;
    }

    .portal-brand-name {
        font-size: 1.4rem;
    }

    .portal-visual-card {
        min-height: auto;
        padding: 18px;
    }

    .portal-visual-card h2 {
        font-size: 1.7rem;
    }

    .portal-visual-card p,
    .portal-story-copy p,
    .portal-feature-item p,
    .portal-story-copy h3 {
        font-size: 1.28rem;
    }

    .portal-form-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .portal-input-group {
        min-height: 54px;
        border-radius: 14px;
    }

    .portal-submit-btn {
        min-height: 54px;
        border-radius: 16px;
        font-size: 0.95rem;
    }

    .portal-security-note {
        align-items: flex-start;
        font-size: 0.88rem;
    }

    .portal-feature-item {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 12px 12px;
    }

    .portal-feature-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .portal-visual-metrics {
        gap: 8px;
    }

    .portal-metric-chip {
        width: 100%;
        justify-content: flex-start;
    }
}

.portal-login-shell .portal-input-group .medical-icon {
    width: 54px;
    min-width: 54px;
    height: 100%;
    padding: 0;
    border-right: none;
    background: transparent;
    color: rgba(170, 193, 224, 0.72);
    justify-content: center !important;
    align-items: center !important;
    display: inline-flex !important;
    box-shadow: none !important;
}

.portal-login-shell .portal-input-group .password-toggle {
    background: transparent;
    color: rgba(170, 193, 224, 0.72);
    border: none;
    box-shadow: none;
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.portal-login-shell .portal-input-group .password-toggle:hover {
    color: #ffffff;
}

.portal-login-shell .portal-input-group input {
    padding-left: 4px;
    min-width: 0;
}

.portal-login-shell .portal-auth-panel {
    min-width: 0;
}

@media (max-width: 560px) {
    .portal-showcase {
        padding-bottom: 16px;
    }

    .portal-access-panel {
        padding-top: 16px;
    }

    .portal-access-header h1 {
        font-size: 1.8rem;
    }

    .portal-access-pill {
        font-size: 0.72rem;
        padding: 7px 12px;
    }

    .portal-brand-subtitle {
        font-size: 0.76rem;
    }

    .portal-visual-card h2 {
        font-size: 1.5rem;
    }

    .portal-feature-list {
        gap: 10px;
    }

    .portal-login-shell .portal-input-group .medical-icon {
        width: 48px;
        min-width: 48px;
        font-size: 0.95rem;
    }

    .portal-login-shell .portal-input-group input {
        font-size: 16px;
    }
}

.login-card--split .login-panel--form .login-header .logo {
    gap: 14px;
    font-size: 31px;
    line-height: 1;
    align-items: center;
}

.login-card--split .login-panel--form .login-brand-image {
    width: 104px;
    height: 104px;
}

.login-card--split .login-panel--form .brand-logo-image {
    padding: 6px;
}

.login-card--split .login-panel--form .medical-input-group input {
    color: #16324f;
}

.login-card--split .login-panel--form .medical-input-group input::placeholder {
    color: #7b8ea5;
}

.login-card--split .login-panel--form .btn-medical {
    background: linear-gradient(135deg, #f8fbff 0%, #dbeafe 100%);
    color: #0f3e7b;
    box-shadow: 0 12px 24px rgba(8, 27, 52, 0.22);
}

.login-card--split .login-panel--form .btn-medical:hover {
    background: linear-gradient(135deg, #ffffff 0%, #bfdbfe 100%);
    color: #0b2f5f;
    box-shadow: 0 16px 28px rgba(8, 27, 52, 0.28);
}

.login-card--split .login-panel--form .btn-medical i {
    color: inherit;
}

.password-toggle {
    color: #607a99;
}

.password-toggle:hover {
    color: var(--auth-primary);
}

.checkmark {
    border-color: var(--auth-border);
    background: #f7fbff;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

.login-form a {
    color: var(--auth-primary);
}

.login-form a:hover {
    color: var(--auth-primary-strong);
}

/* Professional split-login UX enhancements */
.login-card--split {
    grid-template-columns: 1.06fr 0.86fr;
}

.login-card--split .login-panel--form {
    justify-content: center;
}

.login-method-kicker {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    margin-bottom: 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(239, 246, 255, 0.92);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(191, 219, 254, 0.26);
}

.password-row-meta {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.field-assist {
    font-size: 12px;
    color: rgba(239, 246, 255, 0.76);
}

.field-link {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff !important;
    text-decoration: none;
}

.field-link:hover {
    color: #dbeafe;
    text-decoration: underline;
}

@media (max-width: 900px) {
    .login-card--split {
        max-width: 560px !important;
        grid-template-columns: 1fr;
    }

    .login-card--split .login-panel {
        padding: 20px !important;
    }

    .login-panel--qr {
        padding-top: 20px !important;
    }

}

@media (max-width: 480px) {
    .login-method-kicker {
        font-size: 10px;
        padding: 5px 9px;
        margin-bottom: 10px;
    }

    .password-row-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .field-assist,
    .field-link {
        font-size: 11.5px;
    }

}

@media (max-width: 360px) {
    .login-card--split .login-panel--form .login-brand-image {
        width: 72px;
        height: 72px;
    }

    .login-card--split .login-panel--form .login-header .logo {
        font-size: 24px;
        gap: 10px;
    }

}

/* Auth utility pages: forgot/reset password */
.auth-utility-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 20px;
    position: relative;
    z-index: 1;
}

.auth-utility-card {
    width: min(100%, 500px);
    padding: 28px;
    border-radius: 24px;
    border: 1px solid rgba(131, 165, 214, 0.26);
    background: linear-gradient(180deg, rgba(14, 35, 66, 0.96) 0%, rgba(11, 27, 48, 0.98) 100%);
    box-shadow: 0 30px 70px rgba(4, 12, 26, 0.34);
    color: #f8fbff;
}

.auth-utility-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.auth-utility-brand-mark {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(52, 118, 255, 0.96), rgba(33, 171, 245, 0.86));
    box-shadow: 0 16px 28px rgba(8, 20, 38, 0.32);
}

.auth-utility-brand-image {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.auth-utility-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-utility-brand-name {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.auth-utility-brand-subtitle {
    color: rgba(209, 227, 255, 0.76);
    font-size: 0.86rem;
}

.auth-utility-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}

.auth-utility-pill {
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(93, 172, 255, 0.38);
    background: rgba(26, 77, 150, 0.28);
    color: #cfe6ff;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-utility-header h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.04;
    letter-spacing: -0.05em;
    color: #ffffff;
}

.auth-utility-header p {
    margin: 0;
    color: rgba(193, 212, 238, 0.82);
    line-height: 1.6;
    font-size: 0.95rem;
}

.auth-utility-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-utility-form .form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-utility-form label {
    display: block;
    margin-bottom: 0;
    color: #f8fbff;
    font-size: 0.92rem;
    font-weight: 700;
}

.auth-utility-input-group {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    border-radius: 16px;
    border: 1px solid rgba(82, 107, 149, 0.44);
    background: rgba(21, 32, 52, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.auth-utility-input-group:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.16);
}

.auth-utility-input-group input {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    padding: 16px 18px 16px 4px;
    background: transparent;
    color: #f8fbff;
    font-size: 0.96rem;
    line-height: 1.2;
    caret-color: #f8fbff;
}

.auth-utility-input-group input::placeholder {
    color: rgba(161, 184, 216, 0.68);
}

.auth-utility-input-group .medical-icon,
.auth-utility-input-group .password-toggle {
    color: rgba(170, 193, 224, 0.72);
}

.auth-utility-input-group .medical-icon {
    width: 54px;
    min-width: 54px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border-right: none;
    font-size: 1rem;
    box-shadow: none;
}

.auth-utility-submit {
    min-height: 58px;
    margin-top: 4px;
    border-radius: 18px;
    background: linear-gradient(90deg, #2563eb 0%, #1ea5f2 100%);
    box-shadow: 0 18px 28px rgba(29, 78, 216, 0.24);
}

.auth-utility-password-note,
.auth-utility-note {
    color: rgba(193, 212, 238, 0.76);
    font-size: 0.82rem;
    line-height: 1.55;
}

.auth-utility-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 2px;
}

.auth-utility-link {
    color: #8fc7ff;
    font-weight: 700;
    text-decoration: none;
}

.auth-utility-link:hover {
    color: #ffffff;
}

.auth-utility-alert {
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .auth-utility-shell {
        padding: 20px 16px;
        align-items: flex-start;
    }

    .auth-utility-card {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .auth-utility-brand-name {
        font-size: 1.6rem;
    }

    .auth-utility-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .auth-utility-card {
        padding: 20px 16px;
    }

    .auth-utility-header h1 {
        font-size: 1.9rem;
    }
}

/* Two-factor verification page */
.two-factor-shell {
    align-items: center;
    padding-top: 16px;
    padding-bottom: 16px;
}

.two-factor-card {
    width: min(100%, 460px);
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 20px 20px 18px;
    border-radius: 20px;
}

.two-factor-form {
    margin-top: 6px;
    gap: 16px;
}

.two-factor-divider {
    margin-top: -2px;
    padding: 2px 2px 0;
    line-height: 1.6;
}

.two-factor-footer {
    margin-top: 12px;
}

@media (max-width: 640px) {
    .two-factor-card {
        width: 100%;
        padding: 18px 16px 16px;
        max-height: calc(100vh - 24px);
    }

    .two-factor-shell {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .auth-utility-header h1 {
        font-size: 1.55rem;
    }
}

@media (max-height: 760px) {
    .two-factor-card {
        max-height: calc(100vh - 24px);
    }

    .auth-utility-brand {
        margin-bottom: 16px;
    }

    .auth-utility-header {
        margin-bottom: 14px;
    }

    .auth-utility-header h1 {
        font-size: 1.65rem;
    }
}


