body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #1b2430;
}

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

/* CSS Variables for Consistency */
:root {
    --primary: #5a579c;
    --primary-dark: #48458a;
    --primary-light: #7b78b5;
    --accent: #f472ab;
    --accent-light: #fde7f1;
    --bg-light: #e7e7f1;
    --bg-soft: #fde7f1;
    --text-dark: #1a1a2e;
    --text-gray: #5b6b79;
    --text-light: #94a3b8;
    --white: #ffffff;
    --error-bg: #fee2e2;
    --error-border: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-sm: 0.5rem;
    --transition: all 0.3s ease;
    --success: #10b981;

    /* Bootstrap 5 theme overrides */
    --bs-primary: #5a579c;
    --bs-primary-rgb: 90, 87, 156;
    --bs-secondary: #7b78b5;
    --bs-secondary-rgb: 123, 120, 181;
    --bs-link-color: #5a579c;
    --bs-link-hover-color: #48458a;
    --bs-link-color-rgb: 90, 87, 156;
    --bs-body-color: #1a1a2e;
    --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-soft) 100%);
    min-height: 100vh;
}

.app-bg {
    min-height: 100vh;
    background: linear-gradient(140deg, #f7fbff 0%, #eef5fb 40%, #f9fdfb 100%);
}

/* Modern Body Background */
.modern-body {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-soft) 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
}

.app-bg-modern {
    min-height: 100vh;
    padding: 1.5rem;
}

.container-modern {
    max-width: 1280px;
    margin: 0 auto;
}

/* Modern Navigation Bar - For Logged In Users */
.navbar-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.app-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.app-logo-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    display: block;
}

.app-logo-text {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-home-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    color: var(--primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
}

.nav-home-link:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-1px);
}

.nav-home-link i {
    font-size: 0.875rem;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f8f7fc;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.user-info-badge i {
    font-size: 1.25rem;
    color: var(--primary);
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-details strong {
    font-size: 0.875rem;
    color: var(--text-dark);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.btn-logout-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: #fee2e2;
    color: #dc2626;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
}

.btn-logout-modern:hover {
    background: #dc2626;
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Simple Navigation Bar - For Non-Logged Users (non-login pages) */
.navbar-modern-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.nav-home-link-simple {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
}

.nav-home-link-simple:hover {
    background: var(--bg-light);
    color: var(--primary-dark);
}

.btn-login-simple {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
}

.btn-login-simple:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

/* Modern Header Card */
.header-card-modern {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.header-card-modern:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.header-card-slim {
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.header-card-slim .header-content {
    padding: 1.25rem 1.5rem;
}

.header-card-slim .header-icon {
    width: 48px;
    height: 48px;
}

.header-card-slim .header-icon i {
    font-size: 1.5rem;
}

.header-card-slim .header-title {
    font-size: 1.25rem;
}

.header-card-slim .header-subtitle {
    font-size: 0.8rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.75rem 2rem;
    background: var(--white);
    border-bottom: 1px solid rgba(90, 87, 156, 0.15);
}

.header-content .app-logo-image {
    width: 220px;
    height: auto;
    max-height: 110px;
    object-fit: contain;
}

.header-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.header-icon i {
    font-size: 2rem;
    color: var(--white);
}

.header-text {
    flex: 1;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin: 0;
}

/* Modern Stepper Component - Only visible when logged in */
.stepper-modern {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 2rem;
    background: var(--white);
    position: relative;
}

.step-item-modern {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    text-align: center;
}

.step-circle {
    width: 48px;
    height: 48px;
    background: var(--bg-light);
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-gray);
    margin-bottom: 0.75rem;
    transition: var(--transition);
    position: relative;
    z-index: 2;
    background: var(--white);
}

.step-item-modern.step-active .step-circle {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 0 0 4px rgba(90, 87, 156, 0.2);
}

.step-item-modern.step-complete .step-circle {
    background: linear-gradient(135deg, var(--success), #059669);
    border-color: var(--success);
    color: var(--white);
}

.step-item-modern.step-complete .step-circle i {
    font-size: 1rem;
}

.step-label-modern {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.step-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
}

.step-item-modern.step-active .step-name {
    color: var(--primary);
    font-weight: 700;
}

.step-item-modern.step-complete .step-name {
    color: var(--success);
}

.step-connector {
    position: absolute;
    top: 24px;
    left: 50%;
    width: calc(100% - 48px);
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.step-item-modern:last-child .step-connector {
    display: none;
}

.step-item-modern.step-complete + .step-item-modern .step-connector {
    background: linear-gradient(90deg, var(--success), var(--success));
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-bg-modern {
        padding: 1rem;
    }
    
    .navbar-modern, .navbar-modern-simple {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .navbar-left, .navbar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .stepper-modern {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .step-item-modern {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
    }
    
    .step-circle {
        margin-bottom: 0;
    }
    
    .step-connector {
        display: none;
    }
    
    .step-label-modern {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.25rem;
    }
    
    .step-name {
        font-size: 0.75rem;
    }
    
    .user-details strong {
        font-size: 0.75rem;
    }
    
    .btn-logout-modern span,
    .btn-login-simple span,
    .nav-home-link span,
    .nav-home-link-simple span {
        display: none;
    }
    
    .btn-logout-modern,
    .btn-login-simple,
    .nav-home-link,
    .nav-home-link-simple {
        padding: 0.5rem;
    }
    
    .btn-logout-modern i,
    .btn-login-simple i,
    .nav-home-link i,
    .nav-home-link-simple i {
        margin: 0;
    }
    
    .app-logo-image {
        width: 70px;
        height: 70px;
    }
}

/* Hover & Focus States */
.nav-home-link:focus-visible,
.btn-logout-modern:focus-visible,
.btn-login-simple:focus-visible,
.nav-home-link-simple:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Animation for stepper */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.step-item-modern.step-active .step-circle {
    animation: pulse 2s infinite;
}

.login-page-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.login-logo-image {
    width: min(240px, 55vw);
    height: auto;
    display: block;
}

body:has(.login-wrapper-modern) .container-modern {
    padding: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar-modern,
.header-card-modern {
    animation: slideDown 0.4s ease-out;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.risk-meter {
    width: 100%;
    max-width: 520px;
    margin: 1rem auto;
    background: #ffffff;
    border: 1px solid #dbe5f1;
    border-radius: 1rem;
    padding: 1rem 1rem 0.8rem;
    box-shadow: 0 10px 24px rgba(36, 67, 103, 0.08);
}

.speedometer-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1.05;
}

.speedometer-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.gauge-track,
.gauge-segment {
    fill: none;
    stroke-width: 22;
}

.gauge-track {
    stroke: #edf2f8;
    stroke-linecap: round;
}

.gauge-segment {
    /* Arc length is approx 282.74 for r=90 semicircle */
    stroke-linecap: butt;
    stroke-dasharray: 0 282.74;
}

.segment-green {
    stroke: #2ca35f;
    stroke-dasharray: 84.82 282.74;
    stroke-dashoffset: 0;
}

.segment-yellow {
    stroke: #ecb530;
    stroke-dasharray: 84.82 282.74;
    stroke-dashoffset: -84.82;
}

.segment-red {
    stroke: #d74743;
    stroke-dasharray: 113.10 282.74;
    stroke-dashoffset: -169.64;
}

.speedometer-needle {
    position: absolute;
    left: 50%;
    bottom: 12%;
    width: 5px;
    height: 38%;
    background: linear-gradient(180deg, #12263f 0%, #2b4a6f 100%);
    border-radius: 4px;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-90deg);
    transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 3;
    box-shadow: 0 2px 8px rgba(18, 38, 63, 0.3);
}

.speedometer-wrap.ready .speedometer-needle {
    transform: translateX(-50%) rotate(var(--needle-angle, -90deg));
}

@media (prefers-reduced-motion: reduce) {
    .speedometer-needle {
        transition: none;
    }
}

.speedometer-center {
    position: absolute;
    left: 50%;
    bottom: 11%;
    width: 18px;
    height: 18px;
    background: #1f3552;
    border: 3px solid #f8fbff;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 4;
    box-shadow: 0 2px 10px rgba(31, 53, 82, 0.25);
}

.speedometer-tick {
    position: absolute;
    font-size: 0.8rem;
    color: #3f5268;
    font-weight: 700;
}

.tick-0 {
    left: 2%;
    bottom: 14%;
}

.tick-6 {
    left: 23%;
    bottom: 66%;
}

.tick-12 {
    right: 23%;
    bottom: 66%;
}

.tick-20 {
    right: 2%;
    bottom: 14%;
}

.speedometer-score {
    position: absolute;
    left: 50%;
    bottom: 1%;
    transform: translateX(-50%);
    font-size: 0.88rem;
    font-weight: 700;
    color: #1d324d;
}

.risk-legend {
    margin-top: 0.6rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #d9e4f2;
    display: grid;
    gap: 0.45rem;
}

.risk-legend-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid #e2eaf4;
    border-radius: 0.65rem;
    padding: 0.45rem 0.6rem;
    background: #fbfdff;
}

.legend-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.legend-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #30445d;
}

.legend-range {
    font-size: 0.82rem;
    font-weight: 700;
    color: #20354f;
}

.legend-green .legend-dot {
    background: #2ca35f;
}

.legend-yellow .legend-dot {
    background: #ecb530;
}

.legend-red .legend-dot {
    background: #d74743;
}

.risk-pill {
    display: inline-block;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
}

.risk-green {
    background: #d8f6e4;
    color: #0e7f43;
}

.risk-yellow {
    background: #fff2cc;
    color: #8c6b00;
}

.risk-red {
    background: #ffdedd;
    color: #a31616;
}

.symptom-radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.6rem;
}

.symptom-radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    border: 1px solid #d7e0ec;
    border-radius: 0.7rem;
    padding: 0.6rem 0.7rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.symptom-radio-option:hover {
    border-color: #7ea8d8;
    transform: translateY(-1px);
}

.symptom-radio-option:has(input:checked) {
    border-color: #1f6fd1;
    box-shadow: 0 0 0 2px rgba(31, 111, 209, 0.15);
}

.symptom-radio-option .form-check-input {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.symptom-radio-text {
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.3;
}

.symptom-radio-score {
    font-size: 0.75rem;
    font-weight: 700;
    color: #4b5b70;
    white-space: nowrap;
}

.dynamic-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
    vertical-align: middle;
}

.group-icon-after {
    margin-left: 0.35rem;
}

.subgroup-icon-before {
    flex-shrink: 0;
}

.option-score-none {
    background: #c8f0da;
}

.option-score-low {
    background: #fdf5b0;
}

.option-score-medium {
    background: #fde4b8;
}

.option-score-high {
    background: #fdd0cd;
}

@media (max-width: 991px) {
    .stepper-wrap {
        grid-template-columns: repeat(4, minmax(80px, 1fr));
    }
}

@media (max-width: 640px) {
    .stepper-wrap {
        grid-template-columns: repeat(2, minmax(100px, 1fr));
    }
}

@media print {
    .no-print {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #e0e0e0 !important;
    }

    .app-bg {
        background: #fff;
        padding: 0;
    }
}

/* ============================================================
   LOGIN PAGE – Two-Column Layout
   ============================================================ */

.login-wrapper-modern {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
}

.login-container-modern {
    width: 100%;
    max-width: 1100px;
    background: var(--white);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    display: flex;
    box-shadow: var(--shadow-xl);
    min-height: 580px;
}

/* LEFT COLUMN */
.login-brand-col {
    flex: 1.1;
    background: linear-gradient(145deg, var(--primary) 0%, #3d3a80 60%, #2e2c6e 100%);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.login-brand-col::before {
    content: '';
    position: absolute;
    top: -15%;
    right: -15%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(244, 114, 171, 0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-brand-col::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.07) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.brand-content-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 2.5rem;
    text-align: center;
}

.login-logo-block {
    display: flex;
    justify-content: center;
}

.login-brand-logo {
    width: min(220px, 60%);
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.25));
}

.login-brand-description {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1.25rem;
    width: 100%;
}

.brand-desc-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.75;
    margin: 0;
}

.brand-desc-note {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 0.75rem 1rem;
    margin: 0;
    margin-top: auto;
    text-align: left;
}

.brand-desc-note i {
    color: var(--accent);
    margin-right: 0.4rem;
}

/* RIGHT COLUMN */
.login-form-col {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--white);
}

.form-container-modern {
    width: 100%;
    max-width: 380px;
}

.form-header-modern {
    margin-bottom: 2rem;
    text-align: center;
}

.form-header-modern h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.form-header-modern p {
    color: var(--text-gray);
    font-size: 0.875rem;
    margin: 0;
}

/* Alert */
.alert-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-error-modern {
    background: var(--error-bg);
    border-left: 3px solid var(--error-border);
    color: #991b1b;
}

/* Form */
.login-form-modern {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group-modern {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group-modern label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-left {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition);
}

.input-wrapper:focus-within .input-icon-left {
    color: var(--primary);
}

.input-modern {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-lg);
    background: var(--white);
    transition: var(--transition);
    outline: none;
    color: var(--text-dark);
}

.input-modern:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(90, 87, 156, 0.12);
}

.input-modern:hover:not(:focus) {
    border-color: #cbd5e1;
}

/* Password toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper .password-input {
    padding-right: 2.75rem;
}

.password-toggle-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1rem;
    padding: 0.25rem;
    transition: var(--transition);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    color: var(--primary);
}

.password-toggle-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Submit Button */
.btn-login-modern {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-2xl);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.btn-login-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(90, 87, 156, 0.4);
}

.btn-login-modern:active {
    transform: translateY(0);
}

.btn-login-modern:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Override container padding for login page */
.modern-body:has(.login-wrapper-modern) .app-bg-modern {
    padding: 1rem;
}

body:has(.login-wrapper-modern) .container-modern {
    max-width: 1200px;
}

/* Responsive */
@media (max-width: 768px) {
    .login-container-modern {
        flex-direction: column;
        min-height: unset;
    }

    .login-brand-col {
        padding: 2rem 1.5rem;
    }

    .login-brand-logo {
        width: min(160px, 50%);
    }

    .brand-desc-text {
        font-size: 0.9rem;
    }

    .login-form-col {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .form-header-modern h2 {
        font-size: 1.5rem;
    }

    .btn-login-modern {
        padding: 0.75rem 1.25rem;
    }
}

/* ============================================================
   BOOTSTRAP COMPONENT OVERRIDES — App Colour Palette
   Primary: #5a579c  |  Accent: #f472ab
   ============================================================ */

/* Buttons */
.btn-primary {
    --bs-btn-bg: #5a579c;
    --bs-btn-border-color: #5a579c;
    --bs-btn-hover-bg: #48458a;
    --bs-btn-hover-border-color: #48458a;
    --bs-btn-active-bg: #3d3a7a;
    --bs-btn-active-border-color: #3d3a7a;
    --bs-btn-focus-shadow-rgb: 90, 87, 156;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    font-weight: 600;
    border-radius: 0.6rem;
    transition: all 0.25s ease;
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(90,87,156,0.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: none; }

.btn-outline-primary {
    --bs-btn-color: #5a579c;
    --bs-btn-border-color: #5a579c;
    --bs-btn-hover-bg: #5a579c;
    --bs-btn-hover-border-color: #5a579c;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #48458a;
    --bs-btn-active-border-color: #48458a;
    --bs-btn-focus-shadow-rgb: 90, 87, 156;
    font-weight: 600;
    border-radius: 0.6rem;
    transition: all 0.25s ease;
}
.btn-outline-primary:hover { box-shadow: 0 4px 10px rgba(90,87,156,0.25); transform: translateY(-1px); }

.btn-outline-secondary {
    --bs-btn-color: #5b6b79;
    --bs-btn-border-color: #c8d0dc;
    --bs-btn-hover-bg: #e7e7f1;
    --bs-btn-hover-border-color: #7b78b5;
    --bs-btn-hover-color: #48458a;
    --bs-btn-active-bg: #d4d3e8;
    --bs-btn-active-border-color: #7b78b5;
    font-weight: 500;
    border-radius: 0.6rem;
    transition: all 0.25s ease;
}

.btn-success {
    --bs-btn-bg: #7b78b5;
    --bs-btn-border-color: #7b78b5;
    --bs-btn-hover-bg: #6a67a6;
    --bs-btn-hover-border-color: #6a67a6;
    --bs-btn-active-bg: #5a579c;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-focus-shadow-rgb: 123, 120, 181;
    font-weight: 700;
    border-radius: 0.6rem;
    transition: all 0.25s ease;
}
.btn-success:hover { box-shadow: 0 4px 12px rgba(90,87,156,0.35); transform: translateY(-1px); }

.btn-outline-info {
    --bs-btn-color: #7b78b5;
    --bs-btn-border-color: #7b78b5;
    --bs-btn-hover-bg: #7b78b5;
    --bs-btn-hover-border-color: #7b78b5;
    --bs-btn-hover-color: #fff;
    font-weight: 500;
    border-radius: 0.6rem;
}

.btn-outline-dark {
    --bs-btn-color: #3d3a80;
    --bs-btn-border-color: #3d3a80;
    --bs-btn-hover-bg: #3d3a80;
    --bs-btn-hover-border-color: #3d3a80;
    --bs-btn-hover-color: #fff;
    font-weight: 500;
    border-radius: 0.6rem;
}

.btn-sm { border-radius: 0.45rem; font-size: 0.8rem; }

/* Alerts */
.alert-info {
    --bs-alert-color: #3d3a7a;
    --bs-alert-bg: #e7e7f1;
    --bs-alert-border-color: #c4c2de;
    font-weight: 500;
}
.alert-warning {
    --bs-alert-color: #7a5a00;
    --bs-alert-bg: #fff8e1;
    --bs-alert-border-color: #f5d76e;
}
.alert-success {
    --bs-alert-color: #0a5c3e;
    --bs-alert-bg: #d8f6e4;
    --bs-alert-border-color: #74d4a7;
}
.alert-danger {
    --bs-alert-color: #7f1d1d;
    --bs-alert-bg: #fee2e2;
    --bs-alert-border-color: #fca5a5;
}

/* Cards */
.card {
    border-radius: 1rem !important;
    border: 1px solid rgba(90,87,156,0.1) !important;
    box-shadow: 0 4px 16px rgba(90,87,156,0.08) !important;
}
.card-body { padding: 1.75rem !important; }

/* Form Controls */
.form-control,
.form-select {
    border-radius: 0.6rem;
    border-color: #d4d3e8;
    color: #1a1a2e;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus,
.form-select:focus {
    border-color: #5a579c;
    box-shadow: 0 0 0 3px rgba(90,87,156,0.15);
    outline: none;
}
.form-control:hover:not(:focus),
.form-select:hover:not(:focus) { border-color: #7b78b5; }

.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1a1a2e;
    margin-bottom: 0.4rem;
}
.form-text { color: #5b6b79; font-size: 0.8rem; }
.invalid-feedback { font-size: 0.8rem; color: #dc2626; }

.form-check-input:checked {
    background-color: #5a579c;
    border-color: #5a579c;
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(90,87,156,0.2);
    border-color: #5a579c;
}
.form-check-input[type="radio"]:checked {
    background-color: #5a579c;
    border-color: #5a579c;
}

/* Tables */
.table {
    --bs-table-striped-bg: #f0f0f8;
    --bs-table-hover-bg: #e7e7f1;
    font-size: 0.875rem;
}
.table thead tr th {
    background: linear-gradient(135deg, #5a579c, #48458a);
    color: #fff;
    font-weight: 700;
    border-bottom: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem;
}
.table tbody tr td {
    padding: 0.65rem 1rem;
    vertical-align: middle;
    border-color: #e7e7f1;
}

/* Pagination */
.page-link {
    color: #5a579c;
    border-color: #d4d3e8;
    font-weight: 500;
    transition: all 0.2s ease;
}
.page-link:hover {
    color: #fff;
    background-color: #5a579c;
    border-color: #5a579c;
}
.page-item.active .page-link {
    background-color: #5a579c;
    border-color: #5a579c;
    color: #fff;
}
.page-item.disabled .page-link {
    color: #94a3b8;
    border-color: #e2e8f0;
}

/* Typography */
.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #48458a;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e7e7f1;
    margin-bottom: 1rem !important;
}
h2.h5, .h5 { color: #3d3a7a; font-weight: 700; }
a { color: #5a579c; text-decoration: none; }
a:hover { color: #48458a; }
.text-muted { color: #5b6b79 !important; }
.text-secondary { color: #7b78b5 !important; }
hr { border-color: #e7e7f1; opacity: 1; }

/* Symptom radio — primary colour on selected */
.symptom-radio-option:has(input:checked) {
    border-color: #5a579c;
    box-shadow: 0 0 0 2px rgba(90,87,156,0.2);
}
.symptom-radio-option:hover { border-color: #7b78b5; }

.mandatory-asterisk {
    color: #dc2626;
    font-weight: 700;
}

.global-mandatory-note {
    margin: 0 0 1rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 0.5rem;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.875rem;
    font-weight: 600;
}

.global-screening-disclaimer {
    text-align: center;
    margin: 0.75rem auto 1.25rem;
    color: #64748b;
    font-size: 0.75rem;
    font-style: italic;
    max-width: 1280px;
    padding: 0 1rem;
}

.terms-modal-body {
    max-height: min(70vh, 560px);
    overflow-y: auto;
}

.terms-content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.terms-content p,
.terms-content li {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.5;
}

.terms-content ol {
    padding-left: 1.2rem;
}
