/* BMI gradient bar and pointer (lightweight, non-intrusive) */
.bmi-display { text-align: center; }
.bmi-bar {
    position: relative;
    height: 10px;
    border-radius: 999px;
    margin: 8px auto 0;
    max-width: 520px;
    background: linear-gradient(90deg, #fbbf24 0%, #22c55e 20%, #22c55e 45%, #f59e0b 60%, #ef4444 100%);
}
.bmi-pointer {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #111827;
    left: 0%;
    transition: left 0.15s ease-out;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* US Phone Number Formatting Styles */
.phone-note {
    font-size: 0.9rem;
    color: #666;
    margin-top: 4px;
}

.phone-error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 4px;
    display: none;
}

input[type="tel"].form-control.valid {
    border-color: #28a745;
}

input[type="tel"].form-control.invalid {
    border-color: #dc3545;
}

/* Medical Form CSS - Professional Medical Design */

/* Root Variables */
:root {
    /* Red theme palette */
    --primary-color: #dc2626;   /* red-600 */
    --primary-hover: #b91c1c;   /* red-700 */
    --secondary-color: #ef4444; /* red-500 */
    --secondary-hover: #dc2626; /* red-600 */
    --accent-color: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Bootstrap theme overrides to enforce red across components */
:root {
    --bs-primary: #dc2626;
    --bs-primary-rgb: 220, 38, 38;
    --bs-link-color: #dc2626;
    --bs-link-hover-color: #b91c1c;
    --bs-nav-pills-link-active-bg: #dc2626;
}

/* Buttons */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #dc2626;
    --bs-btn-border-color: #dc2626;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #b91c1c;
    --bs-btn-hover-border-color: #b91c1c;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #991b1b;
    --bs-btn-active-border-color: #991b1b;
    --bs-btn-disabled-bg: #fca5a5;
    --bs-btn-disabled-border-color: #fca5a5;
}

.btn-outline-primary {
    --bs-btn-color: #dc2626;
    --bs-btn-border-color: #dc2626;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #dc2626;
    --bs-btn-hover-border-color: #dc2626;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #b91c1c;
    --bs-btn-active-border-color: #b91c1c;
}

/* Link color */
a { 
    /* Fallback first for older / incompatible parsers */
    color: #dc2626; 
    color: var(--bs-link-color, #dc2626);
}
a:hover { 
    color: #b91c1c; 
    color: var(--bs-link-hover-color, #b91c1c);
}

/* Nav pills (ensure red active bg) */
.nav-pills .nav-link.active {
    --bs-nav-pills-link-active-bg: #dc2626;
}

/* Primary utility classes */
.text-primary { color: #dc2626 !important; color: var(--primary-color, #dc2626) !important; }
.bg-primary { background-color: #dc2626 !important; background-color: var(--primary-color, #dc2626) !important; }
.border-primary { border-color: #dc2626 !important; border-color: var(--primary-color, #dc2626) !important; }

/* Form controls checked/focus states */
.form-check-input:checked {
    background-color: #dc2626; background-color: var(--primary-color, #dc2626);
    border-color: #dc2626; border-color: var(--primary-color, #dc2626);
}
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus,
.btn:focus-visible {
    box-shadow: 0 0 0 .25rem rgba(220, 38, 38, 0.25) !important;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fafc;
    color: #374151;
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Legal Disclaimer */
.legal-disclaimer {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    border: 3px solid white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.legal-disclaimer-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    background: linear-gradient(135deg, var(--primary-color, #dc2626) 0%, var(--primary-hover, #b91c1c) 100%);
    color: #fff;
    font-weight: 700;
    padding: .75rem 1rem;
    letter-spacing: .3px;
}
.legal-disclaimer-header i { font-size: 1rem; }
.legal-disclaimer-body {
    padding: 1rem 1.25rem;
    background: #fff;
}
/* Signature agreement checkbox styling */
.signature-agree-check .form-check-input {
    width: 25px;
    height: 25px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: 4px;
}
.signature-agree-check .form-check-input:focus {
    box-shadow: 0 0 0 .15rem rgba(220,38,38,.25);
}
.signature-agree-check .form-check-input:checked {
    background-color: #fff;
    border-color: var(--primary-color);
    position: relative;
}
.signature-agree-check .form-check-input:checked::after {
    content: '\2713'; /* Unicode check mark */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    font-size: .9rem;
    color: var(--primary-color);
    font-weight: 700;
}
.signature-agree-check .form-check-label {
    margin-left: 4px;
    user-select: none;
}
.legal-disclaimer-body p {
    margin: 0 0 .5rem 0;
    color: var(--text-dark);
}

/* Form wrapper for responsive width control */
.form-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
}

/* Enhanced Bootstrap Column Responsive Behavior */
@media (max-width: 991.98px) {
    /* Tablet: Smart 2-column layout for better space usage */
    .form-section .col-md-6,
    .form-section .col-md-4,
    .form-section .col-md-3 {
        flex: 0 0 48% !important;
        max-width: 48% !important;
        margin-bottom: 1rem;
    }
    
    .form-section .col-md-8,
    .form-section .col-md-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
    }
    
    /* Ensure proper spacing between columns */
    .form-section .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .form-section .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

@media (max-width: 767.98px) and (min-width: 481px) {
    /* Medium tablets: Keep 2-column for most fields */
    .form-section .col-md-6,
    .form-section .col-md-4,
    .form-section .col-md-3 {
        flex: 0 0 48% !important;
        max-width: 48% !important;
        margin-bottom: 1rem;
    }
    
    .form-section .col-md-8,
    .form-section .col-md-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    /* Small mobile: Single column only for very small screens */
    .form-section .col-md-6,
    .form-section .col-md-4,
    .form-section .col-md-3,
    .form-section .col-md-8,
    .form-section .col-md-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
        margin-right: 0 !important;
    }
    
    /* Form group spacing */
    .form-section .form-group {
        margin-bottom: 1.25rem !important;
    }
    
    /* Ensure labels are visible and readable */
    .form-section .form-label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 600;
        color: #374151;
        font-size: 0.95rem;
        line-height: 1.3;
    }
    
    /* Form controls optimization */
    .form-section .form-control {
        width: 100%;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        padding: 0.75rem;
        font-size: 16px; /* Prevent zoom on iOS */
        background-color: #fff;
        transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    }
    
    .form-section .form-control:focus {
        border-color: #dc2626;
        box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25);
        outline: 0;
    }
    
    /* Radio and checkbox groups */
    .form-section .form-check-group {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        margin-top: 0.5rem;
    }
    
    .form-section .form-check-inline {
        margin-right: 0;
        margin-bottom: 0;
    }
    
    .form-section .form-check-input {
        margin-top: 0.25rem;
        margin-right: 0.5rem;
    }
    
    .form-section .form-check-label {
        font-size: 0.9rem;
        color: #374151;
        cursor: pointer;
    }
}

/* CRITICAL: Force 2-column layout on tablets and medium screens */
@media (min-width: 481px) and (max-width: 991px) {
    /* Override Bootstrap column behavior */
    .form-section .row .col-md-6,
    .form-section .row .col-md-4, 
    .form-section .row .col-md-3 {
        flex: 0 0 calc(50% - 1rem) !important;
        max-width: calc(50% - 1rem) !important;
        margin-bottom: 1rem !important;
        margin-right: 0.5rem !important;
    }
    
    .form-section .row .col-md-6:nth-child(even),
    .form-section .row .col-md-4:nth-child(even),
    .form-section .row .col-md-3:nth-child(even) {
        margin-right: 0 !important;
    }
    
    .form-section .row .col-md-8,
    .form-section .row .col-md-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem !important;
    }
    
    /* Force row display */
    .form-section .row {
        display: flex !important;
        flex-wrap: wrap !important;
        margin-left: -0.5rem !important;
        margin-right: -0.5rem !important;
    }
    
    .form-section .row > * {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* Force proper layout on specific screen sizes */
@media (min-width: 768px) and (max-width: 991px) {
    .form-section .col-md-6,
    .form-section .col-md-4,
    .form-section .col-md-3 {
        width: 48% !important;
        flex: 0 0 48% !important;
        max-width: 48% !important;
        float: left !important;
        margin-right: 2% !important;
        margin-bottom: 1rem !important;
    }
    
    .form-section .col-md-6:nth-child(2n),
    .form-section .col-md-4:nth-child(2n),
    .form-section .col-md-3:nth-child(2n) {
        margin-right: 0 !important;
    }
}

/* No constraint needed in two-column layout */

/* Header Styles */
.form-header {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    border: 2px solid rgba(220, 38, 38, 0.1);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.08);
    margin-bottom: 2rem;
    padding: 2.5rem;
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    text-align: center;
}

.clinic-title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.form-title {
    font-size: 1.6rem;
    font-weight: 500;
    color: #7f1d1d;
    margin-bottom: 0;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Tab Navigation */
.tab-navigation {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    border: 2px solid rgba(220, 38, 38, 0.1);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.08);
    margin-bottom: 2rem;
    animation: slideInDown 0.6s ease-out 0.3s both;
}

.nav-pills .nav-link {
    color: #7f1d1d;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(220, 38, 38, 0.15);
    margin: 0 0.25rem 0.5rem 0.25rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}

.nav-pills .nav-link:hover {
    color: #991b1b;
    background: rgba(255, 255, 255, 1);
    border-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.15);
}

.nav-pills .nav-link:hover i {
    transform: scale(1.2) rotate(5deg);
    color: #dc2626;
}

.nav-pills .nav-link.active {
    color: white;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
    border-color: #dc2626; border-color: var(--primary-color, #dc2626);
    box-shadow: 
        0 6px 20px rgba(220, 38, 38, 0.4),
        0 0 0 1px rgba(220, 38, 38, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.nav-pills .nav-link.active::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

.nav-pills .nav-link.active:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 8px 30px rgba(220, 38, 38, 0.5),
        0 0 0 1px rgba(220, 38, 38, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nav-pills .nav-link i {
    font-size: 1rem;
    transition: all 0.3s ease;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive tabs */
@media (max-width: 1200px) {
    .nav-pills .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 991.98px) {
    .nav-pills {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .nav-pills .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        margin: 0.1rem;
        border-radius: 8px;
        min-width: auto;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .tab-navigation {
        padding: 0.75rem !important;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    .nav-pills {
        gap: 0.2rem;
    }
    
    .nav-pills .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        margin: 0.1rem;
        border-radius: 6px;
        text-align: center;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-pills .nav-link i {
        display: none;
    }
    
    /* Form section improvements */
    .form-section {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 16px;
        border: 1px solid rgba(220, 38, 38, 0.1);
    }
}

@media (max-width: 575.98px) {
    .tab-navigation {
        padding: 0.5rem !important;
        margin-bottom: 0.75rem;
    }
    
    .nav-pills .nav-link {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
        margin: 0.1rem;
        border-radius: 5px;
        min-height: 36px;
        line-height: 1.2;
    }
    
    /* Make tabs more touch-friendly */
    .nav-pills .nav-link {
        flex: 1 1 calc(50% - 0.2rem);
        max-width: calc(50% - 0.2rem);
        text-align: center;
    }
    
    /* Form section mobile */
    .form-section {
        padding: 1rem !important;
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    .section-title {
        font-size: 1.2rem !important;
        text-align: center;
        margin-bottom: 1.5rem;
        color: #7f1d1d;
        font-weight: 700;
    }
}

/* Form Container */
.medical-form-container {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    border: 2px solid rgba(220, 38, 38, 0.1);
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.1);
    overflow: hidden;
    position: relative;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

/* Form Sections */
.form-section {
    padding: 2.5rem;
    position: relative;
    z-index: 1;
}

.section-title {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(220, 38, 38, 0.2);
    position: relative;
    animation: sectionTitleSlide 0.6s ease-out;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #dc2626, #b91c1c);
}

/* Form Controls */
.form-label {
    color: #7f1d1d;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    text-shadow: none;
}

.form-control {
    border: 2px solid rgba(220, 38, 38, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: #374151;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}

.form-control:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15), 0 4px 12px rgba(220, 38, 38, 0.1);
    outline: none;
    background: rgba(255, 255, 255, 0.95);
}

.form-control:hover {
    border-color: rgba(220, 38, 38, 0.4);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

/* Textarea specific */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
    border: 2px solid rgba(220, 38, 38, 0.2);
    background: rgba(255, 255, 255, 0.95);
    color: #374151;
    font-weight: 500;
}


/* Form Check Groups */
.form-check-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.form-check {
    margin-bottom: 0;
}

.form-check-input {
    margin-top: 0;
    margin-right: 0.5rem;
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    border: 2px solid rgba(220, 38, 38, 0.3);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.form-check-input:focus {
    border-color: #dc2626; border-color: var(--primary-color, #dc2626);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-check-input:checked {
    background-color: #dc2626; background-color: var(--primary-color, #dc2626);
    border-color: #dc2626; border-color: var(--primary-color, #dc2626);
}

.form-check-label {
    cursor: pointer;
    font-weight: 600;
    color: #7f1d1d;
    text-shadow: none;
    font-size: 0.95rem;
}

/* Checkbox Groups for Multiple Selection */
.checkbox-group .form-check {
    margin-bottom: 0.75rem;
}

.checkbox-group .form-check-input {
    margin-top: 0.1rem;
}

/* Symptoms Table */
.symptoms-table {
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid rgba(220, 38, 38, 0.15);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.08);
}

.symptoms-table thead th {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    font-weight: 600;
    text-align: center;
    padding: 1rem 0.5rem;
    border: none;
    font-size: 0.85rem;
}

.symptoms-table tbody tr:nth-child(even) {
    background: rgba(254, 242, 242, 0.5);
}

.symptoms-table tbody tr:hover {
    background: rgba(254, 226, 226, 0.6);
}

.symptoms-table tbody td {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border-color: rgba(220, 38, 38, 0.1);
    vertical-align: middle;
}

.symptoms-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
    color: #7f1d1d;
    padding-left: 1rem;
    background: rgba(255, 255, 255, 0.8);
}

.symptoms-table input[type="checkbox"],
.symptoms-table input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.symptoms-table input[type="text"] {
    border: 2px solid #dc2626;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    width: 100%;
    max-width: 120px;
    background: white;
    color: #1e293b;
    font-weight: 500;
}

/* Form Navigation */
.form-navigation {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    padding: 1.5rem 2.5rem;
    border-top: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 0 0 20px 20px;
}

.btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-color: transparent;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
}

.btn-outline-primary {
    color: #dc2626; color: var(--primary-color, #dc2626);
    border-color: #dc2626; border-color: var(--primary-color, #dc2626);
    background: rgba(255, 255, 255, 0.9);
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
}

.btn-success {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background: var(--secondary-hover);
    border-color: var(--secondary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Loading State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Required Field Indicator */
.form-label:has(+ .form-control[required])::after,
.form-label[for*="required"]::after {
    content: " *";
    color: #dc2626;
    font-weight: bold;
}

/* Disabled styling when 'None of the below' selected */
.disabled-cond[disabled] + label { opacity:.45; }

/* Enhanced Responsive Design */
@media (max-width: 991.98px) {
    /* Stack columns properly on tablet */
    .col-lg-5, .col-xl-4,
    .col-lg-7, .col-xl-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .promo-banner-left {
        min-height: 300px;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    /* Tablet: 2 fields per row for better space usage */
    .form-section .col-md-6,
    .form-section .col-md-4,
    .form-section .col-md-3 {
        flex: 0 0 48% !important;
        max-width: 48% !important;
        margin-bottom: 1rem;
    }
    
    .form-section .col-md-8,
    .form-section .col-md-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
    }
    
    /* Fix spacing */
    .form-section .row {
        margin-left: -0.5rem !important;
        margin-right: -0.5rem !important;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .form-section .row > * {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

@media (max-width: 768px) {
    .clinic-title {
        font-size: 2rem;
    }
    
    .form-title {
        font-size: 1.2rem;
    }
    
    .form-section {
        padding: 1.25rem;
    }
    
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
    
    .form-navigation {
        padding: 1rem 1.25rem;
    }
    
    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}
    
    /* Fix column stacking and spacing */
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Responsive column behavior */
    .col-md-6,
    .col-md-4,
    .col-md-3,
    .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 0.75rem;
    }
    
    /* Keep some 2-column layouts on tablet */
    .row .col-md-6:nth-child(odd):not(:last-child) {
        flex: 0 0 48%;
        max-width: 48%;
        margin-right: 4%;
    }
    
    .row .col-md-6:nth-child(even) {
        flex: 0 0 48%;
        max-width: 48%;
    }
    
    /* Form controls improvements */
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.625rem 0.75rem;
    }
    
    .form-label {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }
    
    .form-check-group {
        gap: 1rem;
    }
    
    .form-check-inline {
        margin-right: 1.5rem;
    }
    
    /* Personal History sections */
    .ph-stacked-sections {
        gap: 2rem;
    }
    
    .ph-section-block {
        padding: 1rem;
    }
    
    .ph-section-title {
        font-size: 1.1rem;
    }
    
    /* Medical conditions grid */
    .ph-conditions-grid .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Option blocks */
    .option-block-radio,
    .option-block-check {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .option-block-radio span,
    .option-block-check span {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    /* Symptoms table */
    .symptoms-table {
        font-size: 0.8rem;
    }
    
    .symptoms-table thead th {
        padding: 0.75rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .symptoms-table tbody td {
        padding: 0.5rem 0.25rem;
    }
    
    .symptoms-table tbody td:first-child {
        padding-left: 0.5rem;
    }

@media (max-width: 576px) {
    .tab-navigation {
        padding: 0.75rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.3rem;
        text-align: center;
    }
    
    /* Force single column on mobile */
    .row > * {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
    }
    
    /* Compact form controls */
    .form-control {
        font-size: 16px;
        padding: 0.6rem 0.75rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
        font-weight: 600;
    }
    
    /* Radio/checkbox groups */
    .form-check-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .form-check-inline {
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
    
    .form-check-input {
        margin-top: 0.125rem;
    }
    
    /* Personal History mobile optimization */
    .ph-stacked-sections {
        gap: 1.5rem;
    }
    
    .ph-section-block {
        border-radius: 12px;
    }

    .ph-section-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .ph-section-title:before {
        width: 8px;
        height: 8px;
    }
    
    /* Compact option blocks */
    .option-block-radio,
    .option-block-check {
        padding: 0.65rem 0.75rem;
        border-radius: 8px;
        margin-bottom: 0.4rem;
    }
    
    .option-block-radio span,
    .option-block-check span {
        font-size: 0.85rem;
        line-height: 1.25;
    }
    
    /* Textarea adjustments */
    textarea.form-control {
        min-height: 80px;
        resize: vertical;
    }
    
    /* Button improvements */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-height: 44px; /* Touch target */
    }
    
    /* Navigation buttons */
    .form-navigation .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .form-navigation .row > .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .form-navigation .row > .col-6:first-child {
        margin-bottom: 0.5rem;
    }
    
    /* Symptoms table mobile */
    .symptoms-table {
        font-size: 0.75rem;
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .symptoms-table thead th {
        font-size: 0.7rem;
        padding: 0.5rem 0.2rem;
        min-width: 80px;
    }
    
    .symptoms-table tbody td {
        padding: 0.4rem 0.2rem;
        min-width: 80px;
    }
    
    .symptoms-table input[type="text"] {
        max-width: 70px;
        font-size: 0.75rem;
        padding: 0.25rem;
    }
    
    /* Tab navigation mobile */
    .nav-pills {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .nav-pills .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        margin: 0.1rem;
        border-radius: 6px;
        white-space: nowrap;
    }
}

/* Animation for tab transitions */
.tab-pane {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-pane.show.active {
    opacity: 1;
    transform: translateY(0);
}

/* Focus styles for accessibility */
.form-control:focus-visible,
.form-check-input:focus-visible,
.btn:focus-visible {
    outline: 2px solid #dc2626; outline: 2px solid var(--primary-color, #dc2626);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .tab-navigation,
    .form-navigation {
        display: none;
    }
    
    .tab-pane {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .form-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* Signature Section Styles */
.signature-section {
    border-top: 2px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 2rem;
}

.signature-title {
    color: #dc2626; color: var(--primary-color, #dc2626);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.signature-instructions {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.signature-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 2px solid var(--border-color);
}

/* Provide Signature - simple checkbox on the right */
.provide-signature-mini { 
    display: flex; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 1rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    min-width: 120px;
    flex-shrink: 0;
}
.provide-signature-mini .form-check-input {
    width: 1.2rem; 
    height: 1.2rem; 
    cursor: pointer; 
    border: 2px solid var(--border-color);
    margin: 0;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    border-radius: 4px;
}
.provide-signature-mini .form-check-input:checked { 
    background-color: var(--primary-color); 
    border-color: var(--primary-color);
}
.provide-signature-mini .form-check-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}
.provide-signature-mini .form-check-label { 
    cursor: pointer; 
    font-weight: 600; 
    color: var(--text-dark);
    text-align: center;
    font-size: 0.85rem;
    margin: 0;
}

/* Disabled canvas state until user enables Provide signature */
.signature-disabled #signature-pad { cursor: not-allowed; filter: grayscale(.1) brightness(.97); }
.signature-disabled .signature-pad-wrapper { opacity: .75; }
.signature-disabled .signature-placeholder { opacity: 1 !important; visibility: visible !important; }
.signature-controls .btn:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }

/* Signature layout wrapper */
.signature-layout-flex {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.signature-pad-wrapper {
    position: relative;
    display: inline-block;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: #fafafa;
    overflow: hidden;
    flex: 1;
}

.signature-pad-wrapper canvas {
    display: block;
    background: white;
    cursor: crosshair;
    border-radius: var(--border-radius);
    touch-action: none;
}

#signature-pad {
    display: block;
    background: white;
    cursor: crosshair;
    border-radius: var(--border-radius);
    touch-action: none;
}

.signature-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
    background: rgba(248, 250, 252, 0.9);
    transition: var(--transition);
}

.signature-placeholder.hidden {
    opacity: 0;
    visibility: hidden;
}

.signature-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.signature-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.signature-validation-message {
    margin-left: auto;
}

.signature-info .form-control {
    font-size: 0.9rem;
}

.signature-info .form-label {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 600;
}

.acknowledgment-section {
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.acknowledgment-section .form-check-label {
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.5;
}

.acknowledgment-section .form-check-input {
    margin-top: 0.25rem;
}

/* Signature Submit Section */
.signature-submit {
    border-top: 2px solid var(--border-color);
    padding-top: 2rem;
}

.signature-submit .btn-lg {
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.signature-submit .btn-success {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.signature-submit .btn-success:hover {
    background: var(--secondary-hover);
    border-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(16, 185, 129, 0.3);
}

/* Signature pad responsive */
@media (max-width: 768px) {
    .signature-layout-flex {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .provide-signature-mini {
        order: -1;
        flex-direction: row;
        justify-content: center;
        min-width: auto;
        padding: 0.75rem;
    }
    
    #signature-pad {
        width: 100%;
        max-width: 500px;
        height: 150px;
    }
    
    .signature-pad-wrapper {
        width: 100%;
        max-width: 500px;
    }
    
    .signature-controls {
        justify-content: center;
    }
    
    .signature-validation-message {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

@media (max-width: 576px) {
    .signature-layout-flex {
        gap: 0.75rem;
    }
    
    .provide-signature-mini {
        padding: 0.5rem 0.75rem;
        gap: 0.35rem;
    }
    
    .provide-signature-mini .form-check-label {
        font-size: 0.8rem;
    }
    
    #signature-pad {
        height: 120px;
    }
    
    .signature-title {
        font-size: 1.3rem;
    }
    
    .signature-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .signature-controls .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Progressive Validation Styles */
.nav-pills .nav-item {
    position: relative;
    transition: var(--transition);
}

/* Tab States */
.nav-pills .nav-item.tab-started .nav-link {
    background-color: #fff3cd !important;
    border: 2px solid #ffc107;
    color: #856404 !important;
    position: relative;
}

.nav-pills .nav-item.tab-completed .nav-link {
    background-color: #d1e7dd !important;
    border: 2px solid var(--secondary-color);
    color: #0f5132 !important;
    font-weight: 600;
}

.nav-pills .nav-item.tab-locked .nav-link {
    background-color: #f8f9fa !important;
    border: 2px solid #dee2e6;
    color: #6c757d !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.nav-pills .nav-item.tab-locked .nav-link:hover {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    transform: none;
}

/* Tab Icons */
.completion-icon {
    animation: slideIn 0.3s ease-out;
}

.lock-icon {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Progressive validation error message */
.progressive-validation-error {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tab hover effects with validation states */
.nav-pills .nav-item:not(.tab-locked) .nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Active tab styles */
.nav-pills .nav-link.active {
    background-color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Required field indicators during progressive validation */
.tab-started .form-control:required:invalid,
.tab-started .form-select:required:invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.tab-started .form-control:required:valid,
.tab-started .form-select:required:valid {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25);
}

/* Progress indicator for tabs */
.nav-pills .nav-item::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 3px;
}

.nav-pills .nav-item.tab-completed::before {
    width: 80%;
    background-color: var(--secondary-color);
}

.nav-pills .nav-item.tab-started::before {
    width: 50%;
    background-color: #ffc107;
}

/* Incomplete field highlighting */
.field-incomplete {
    animation: shake 0.5s ease-in-out;
    border: 2px solid #dc3545 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.form-check-group.field-incomplete {
    padding: 8px;
    border: 2px solid #dc3545;
    border-radius: 6px;
    background-color: #fff5f5;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Enhanced error message styling */
.progressive-validation-error {
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid #dc3545 !important;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

.progressive-validation-error .fas {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Locked input field styling */
.locked-field {
    cursor: not-allowed !important;
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #6c757d !important;
    position: relative;
}

.locked-field:focus {
    outline: none;
    box-shadow: none !important;
}

/* Emphasize incomplete required fields when attempting to navigate */
.field-incomplete {
    position: relative;
}
.field-incomplete::after {
    content: 'Required';
    position: absolute;
    top: -8px;
    right: 8px;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    letter-spacing: .5px;
}

.locked-field::before {
    content: '🔒';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    z-index: 10;
    pointer-events: none;
}

.locked-field:hover {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    box-shadow: none !important;
}

/* Enhanced tab locking visual feedback */
.nav-pills .nav-item.tab-locked {
    position: relative;
}

.nav-pills .nav-item.tab-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.8);
    z-index: 1;
    border-radius: 6px;
}

/* Submission Success Overlay */
body.no-scroll {
    overflow: hidden;
}

.submission-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay .4s ease forwards;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.submission-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: #ffffff;
    backdrop-filter: none;
}

.submission-overlay-content {
    position: relative;
    max-width: 420px;
    width: 90%;
    background: #ffffff;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    text-align: center;
    animation: popIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition: opacity 0.5s ease;
    animation: popIn .5s cubic-bezier(.22,1.15,.48,1.12);
}

.submission-overlay-content::before {
    content: '';
    position: absolute;
    top: -60px; left: -60px;
    width: 180px; height: 180px;
    background: radial-gradient(circle at center, rgba(34,197,94,0.15), transparent 70%);
    pointer-events: none;
}
.submission-overlay-content::after {
    content: '';
    position: absolute;
    bottom: -70px; right: -70px;
    width: 220px; height: 220px;
    background: radial-gradient(circle at center, rgba(34,197,94,0.15), transparent 70%);
    pointer-events: none;
}

.success-icon-wrapper { margin-bottom: 1.5rem; }
.success-icon-circle {
    width: 80px; height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    background: #22c55e;
    display:flex; align-items:center; justify-content:center;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
    animation: scalePulse 0.8s ease;
}
.success-icon-circle i {
    font-size: 2.2rem; color:#fff;
    animation: checkAppear .5s .2s ease forwards;
    opacity: 0;
}

.submission-title {
    font-weight: 700;
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 0.75rem;
    letter-spacing: .3px;
}

.submission-message {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 0;
}

.submission-actions { display:flex; gap:1rem; flex-wrap:wrap; justify-content:center; margin-bottom:1.25rem; }
.submission-actions .btn { min-width: 210px; font-weight:600; box-shadow: var(--shadow-md); }
.submission-actions .btn-success { background: linear-gradient(135deg, #dc2626, #b91c1c); border:none; }
.submission-actions .btn-success:hover { filter: brightness(1.05); transform: translateY(-2px); }
.submission-actions .btn-outline-primary { border:2px solid var(--primary-color); color: var(--primary-color); background:#fff; }
.submission-actions .btn-outline-primary:hover { background: var(--primary-color); color:#fff; }

.submission-footer-note { font-size:.8rem; color:#64748b; margin:0; }

@media (max-width: 640px) {
    .submission-overlay-content { padding: 2rem 1.5rem; }
    .submission-title { font-size: 1.6rem; }
    .submission-message { font-size: 0.9rem; }
    .success-icon-circle { width: 70px; height: 70px; }
    .success-icon-circle i { font-size: 1.8rem; }
}

@keyframes fadeInOverlay { from { opacity:0; } to { opacity:1; } }
@keyframes popIn { 0% { transform: scale(.85) translateY(25px); opacity:0; } 60% { transform: scale(1.03); opacity:1; } 100% { transform: scale(1); opacity:1; } }
@keyframes scalePulse { 0% { transform: scale(0); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes checkAppear { to { opacity:1; transform: scale(1); } }

/* === New Beautiful Animation Keyframes === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes formContainerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes sectionTitleSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes subtitleFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes headerShine {
    0%, 100% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
        opacity: 0;
    }
    50% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
        opacity: 0.3;
    }
}

@keyframes tabNavigationShine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes titleShine {
    0% {
        left: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

@keyframes backgroundPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* Stunning pulse animation for the banner circle */
@keyframes stunningPulse {
    0% {
        transform: scale(1);
        box-shadow: 
            0 0 0 6px rgba(255, 255, 255, 0.4),
            0 0 0 12px rgba(255, 255, 255, 0.2),
            0 4px 12px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 
            0 0 0 10px rgba(255, 255, 255, 0.6),
            0 0 0 20px rgba(255, 255, 255, 0.3),
            0 0 0 30px rgba(255, 255, 255, 0.1),
            0 6px 20px rgba(0, 0, 0, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 
            0 0 0 6px rgba(255, 255, 255, 0.4),
            0 0 0 12px rgba(255, 255, 255, 0.2),
            0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

/* === Two Column Layout System === */
.main-layout-container {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.main-layout-container .container-fluid {
    min-height: 100vh;
    padding: 0;
}

.main-layout-container .row {
    margin: 0;
    align-items: stretch;
}

/* === Left Column - GLP-1 Banner === */
.promo-banner-left {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem;
    /* Enhanced red gradient to match right side */
    background: linear-gradient(135deg, 
        #dc2626 0%,     /* red-600 */
        #b91c1c 25%,   /* red-700 */
        #991b1b 50%,   /* red-800 */
        #7f1d1d 75%,   /* red-900 */
        #450a0a 100%   /* red-950 */
    );
    overflow: hidden;
}

.promo-banner-left .promo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgb(254, 242, 242) 0%, rgb(254, 226, 226) 25%,
     rgb(254, 202, 202) 50%, rgb(252, 165, 165) 75%, rgb(248, 113, 113) 100%);
    pointer-events: none;
}

.promo-content-left {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.promo-banner-left .promo-left {
    width: 100%;
    margin-bottom: 2rem;
}

.promo-banner-left .promo-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 800;
    line-height: 1.1;
    color: #492121;
    margin: 0 0 1.5rem;
    animation: fadeInLeft 0.8s ease-out;
    position: relative;
}

.promo-banner-left .promo-accent {
    color: #d97706;
    display: block;
    margin-top: 0.25rem;
    font-weight: 900;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Compounded Semaglutide Medical Section */
.promo-banner-left .promo-medical-section {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 2rem;
    margin: 1rem 0 0 0;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.promo-banner-left .promo-medical-section:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.5);
}

.promo-banner-left .promo-medical-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 900;
    color: #1f2937;
    margin: 0 0 1.5rem;
    text-align: center;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    animation: subtitleFade 0.8s ease-out 0.6s both;
}

.promo-banner-left .promo-support-lines {
    display: grid;
    gap: 1rem;
}

.promo-banner-left .promo-support-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.promo-banner-left .promo-support-line:hover {
    transform: translateX(8px) scale(1.02);
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(251, 191, 36, 0.8);
    color: #dc2626;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 1);
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.3);
}

.promo-banner-left .promo-support-line i {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #ffffff;
    box-shadow: 
        0 0 8px rgba(220, 38, 38, 0.6),
        0 3px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.promo-banner-left .promo-support-line:hover i {
    transform: scale(1.2) rotate(10deg);
    box-shadow: 
        0 0 15px rgba(220, 38, 38, 0.8),
        0 4px 12px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

@keyframes medicalTitleGlow {
    0% {
        text-shadow: 
            0 0 12px rgba(255, 255, 255, 0.9),
            0 0 20px rgba(255, 255, 255, 0.6),
            0 2px 8px rgba(0, 0, 0, 0.5);
    }
    100% {
        text-shadow: 
            0 0 18px rgba(255, 255, 255, 1),
            0 0 28px rgba(255, 255, 255, 0.8),
            0 0 35px rgba(255, 255, 255, 0.6),
            0 2px 12px rgba(0, 0, 0, 0.6);
    }
}

.promo-banner-left .promo-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.promo-banner-left .promo-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.promo-banner-left .promo-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.promo-banner-left .promo-stat-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.5);
}

.promo-banner-left .promo-stat-number {
    font-size: clamp(1.8rem, 2.5vw, 2.2rem);
    font-weight: 700;
    color: #dc2626;
    line-height: 1;
}

.promo-banner-left .promo-stat-label {
    font-size: 0.95rem;
    color: #374151;
    margin-top: 4px;
    letter-spacing: .3px;
    font-weight: 500;
}

.promo-banner-left .promo-features {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.promo-banner-left .promo-pill {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    line-height: 1.3;
    color: #374151;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.promo-banner-left .promo-pill:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 1);
    border-color: rgba(220, 38, 38, 0.2);
}

.promo-banner-left .promo-pill i {
    color: #dc2626;
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.promo-banner-left .promo-pill:hover i {
    color: #b91c1c;
    transform: scale(1.1);
}

.promo-banner-left .promo-pill strong {
    color: #111827;
    font-weight: 700;
}

.promo-banner-left .promo-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}

/* New centered visual circle between sections */
.promo-banner-left .promo-visual-center {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem;
}

.promo-banner-left .promo-map-circle {
    position: relative;
    width: clamp(120px, 25vw, 200px);
    height: clamp(120px, 25vw, 200px);
    background: radial-gradient(circle at 50% 50%, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(248, 113, 113, 0.6) 40%, 
        rgba(220, 38, 38, 0.8) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.4s ease;
    cursor: pointer;
}

.promo-banner-left .promo-map-circle:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.8);
}

.promo-banner-left .pulse-dot {
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    position: relative;
    box-shadow: 
        0 0 0 6px rgba(255, 255, 255, 0.4),
        0 0 0 12px rgba(255, 255, 255, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.3);
    animation: stunningPulse 2.5s infinite;
}

/* === Right Column - Form === */
.form-column {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 25%, #fecaca 50%, #fca5a5 75%, #f87171 100%);
    position: relative;
    overflow-y: auto;
}

.form-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(220, 38, 38, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(185, 28, 28, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.form-column .form-wrapper {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    max-width: 100%;
}

/* === Responsive Design === */
@media (max-width: 991px) {
    .main-layout-container .row {
        align-items: stretch;
    }
    
    /* Stack banner on top, form below */
    .col-lg-5, .col-xl-4 {
        order: 1;
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .col-lg-7, .col-xl-8 {
        order: 2;
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .promo-banner-left {
        min-height: auto;
        padding: 2rem 1.5rem;
    }
    
    .promo-content-left {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        text-align: left;
        gap: 1rem;
    }
    
    .promo-banner-left .promo-visual {
        order: -1;
        margin-bottom: 0;
        margin-top: 0;
        margin-right: 1rem;
    }
    
    .form-column {
        min-height: auto;
        padding: 1.5rem 1rem;
    }
    
    .form-wrapper {
        max-width: none;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .promo-banner-left {
        padding: 1.5rem 1rem;
    }
    
    .promo-content-left {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .form-column {
        padding: 1rem 0.75rem;
    }
    
    /* Ensure form container takes full width */
    .medical-form-container {
        margin: 0;
        border-radius: 16px;
    }
    
    .form-wrapper {
        padding: 0;
    }
    
    /* Tab navigation improvements */
    .tab-navigation {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .nav-pills {
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .promo-banner-left {
        padding: 1.5rem 1rem;
    }
    
    .promo-banner-left .promo-stats {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .promo-banner-left .promo-stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .promo-banner-left .promo-pill {
        font-size: 0.85rem;
        padding: 0.65rem 0.85rem;
    }
    
    .form-column {
        padding: 0.75rem 0.5rem;
    }
    
    .medical-form-container {
        border-radius: 12px;
        box-shadow: 0 8px 20px rgba(220, 38, 38, 0.1);
    }
    
    /* Header adjustments */
    .form-header {
        padding: 1.5rem 1rem !important;
    }
    
    .clinic-title {
        font-size: 1.75rem;
    }
    
    .form-title {
        font-size: 1.1rem;
    }
}

/* === Weight Loss Goals Section === */
.weight-goals-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.1);
}

.weight-goal-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: #7f1d1d;
    text-align: center;
    margin-bottom: 2rem;
    display: block;
}

.weight-goal-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.weight-goal-option {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(220, 38, 38, 0.2);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}

.weight-goal-option:hover {
    border-color: rgba(220, 38, 38, 0.4);
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.15);
}

.weight-goal-option .form-check-input {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(220, 38, 38, 0.4);
    background: rgba(255, 255, 255, 0.9);
}

.weight-goal-option .form-check-input:checked {
    background-color: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.weight-goal-option .form-check-label {
    cursor: pointer;
    margin-left: 2.5rem;
    width: 100%;
    color: #374151;
    font-weight: 500;
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0;
}

.weight-goal-option.checked {
    border-color: #dc2626;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.2);
}

.weight-goal-option.checked .goal-text {
    color: #7f1d1d;
    font-weight: 600;
}

@media (max-width: 768px) {
    .weight-goals-container {
        padding: 1.5rem;
    }
    
    .weight-goal-label {
        font-size: 1.25rem;
    }
    
    .weight-goal-option {
        padding: 1rem 1.25rem;
    }
    
    .weight-goal-option .form-check-label {
        font-size: 1rem;
        margin-left: 2rem;
    }
    
    .weight-goal-option .form-check-input {
        left: 1.25rem;
        width: 1.1rem;
        height: 1.1rem;
    }
}

/* === Height & Weight Section === */
.height-weight-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 1.5rem;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.1);
}

.height-weight-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #7f1d1d;
    margin-bottom: 2rem;
}

/* BMI Display */
.bmi-display {
    text-align: center;
    margin-bottom: 2rem;
}

.bmi-label {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.bmi-value {
    font-size: 3rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 1rem;
    line-height: 1;
}

.bmi-slider {
    position: relative;
    height: 12px;
    background: linear-gradient(to right, 
        #fbbf24 0%, 
        #22c55e 25%, 
        #22c55e 50%, 
        #f59e0b 75%, 
        #ef4444 100%
    );
    border-radius: 6px;
    margin: 1rem auto;
    max-width: 300px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bmi-indicator {
    position: absolute;
    top: -4px;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #374151;
    border-radius: 50%;
    transform: translateX(-50%);
    transition: left 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bmi-labels {
    display: flex;
    justify-content: space-between;
    max-width: 300px;
    margin: 0.5rem auto 0;
    font-size: 0.75rem;
    color: #64748b;
}

.bmi-label-text {
    font-weight: 500;
}

/* Height & Weight Form Styling */
.height-weight-section .form-control {
    border: 2px solid rgba(220, 38, 38, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.height-weight-section .form-control:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
    background: white;
}

.height-weight-section .form-label {
    font-weight: 600;
    color: #7f1d1d;
    margin-bottom: 0.5rem;
}

/* Responsive BMI Display */
@media (max-width: 768px) {
    .height-weight-section {
        padding: 1.5rem;
    }
    
    .height-weight-title {
        font-size: 1.3rem;
    }
    
    .bmi-value {
        font-size: 2.5rem;
    }
    
    .bmi-slider {
        max-width: 250px;
    }
    
    .bmi-labels {
        max-width: 250px;
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .bmi-labels .bmi-label-text {
        font-size: 0.65rem;
    }
    
    .bmi-slider {
        max-width: 200px;
    }
    
    .bmi-labels {
        max-width: 200px;
    }
}

/* === Personal History Stacked Sections (replacing subtabs) === */
.ph-stacked-sections { 
    display: flex; 
    flex-direction: column; 
    gap: 3rem; 
}

.ph-section-block { 
    background: rgba(255,255,255,0.95); 
    border:1px solid rgba(220,38,38,0.18); 
    border-radius:14px; 
    padding:1.25rem 1.25rem 1.5rem; 
    box-shadow:0 6px 20px -4px rgba(0,0,0,0.25); 
    position:relative; 
}

.ph-section-block:before { 
    content:""; 
    position:absolute; 
    inset:0; 
    border-radius:14px; 
    background:linear-gradient(135deg, rgba(220,38,38,0.15), rgba(185,28,28,0.05)); 
    opacity:.55; 
    pointer-events:none; 
}

.ph-section-title { 
    font-size:1.15rem; 
    font-weight:700; 
    color:#7f1d1d; 
    letter-spacing:.5px; 
    display:flex; 
    align-items:center; 
    gap:.5rem; 
}

.ph-section-title:before { 
    content:""; 
    width:10px; 
    height:10px; 
    border-radius:50%; 
    background:#dc2626; 
    box-shadow:0 0 0 4px rgba(220,38,38,.18); 
}

/* Mobile responsive Personal History sections */
@media (max-width: 767.98px) {
    .ph-stacked-sections {
        gap: 2rem;
    }
    
    .ph-section-block {
        border-radius: 12px;
        margin-bottom: 0;
    }
    
    .ph-section-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .ph-section-title:before {
        width: 8px;
        height: 8px;
    }
    
    /* Medical conditions grid mobile */
    .ph-conditions-grid {
        margin: 0 !important;
    }
    
    .ph-conditions-grid .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding: 0.25rem !important;
        margin-bottom: 0.5rem;
    }
    
    .ph-conditions-grid .form-check {
        margin-bottom: 0.75rem;
        padding: 0;                 /* remove card-like padding */
        border: 0;                  /* remove border box */
        border-radius: 0;           /* no rounded container */
        background: transparent;    /* transparent background */
        box-shadow: none;           /* no shadow */
    }
    
    .ph-conditions-grid .form-check-label {
        font-size: 0.9rem;
        line-height: 1.3;
        margin-left: 0.5rem;
    }
    
    /* Option blocks mobile */
    .ph-option-vertical {
        gap: 0.5rem !important;
    }
    
    .option-block-radio,
    .option-block-check {
        padding: 0.75rem !important;
        border-radius: 8px !important;
        margin-bottom: 0.5rem !important;
    }
    
    .option-block-radio span,
    .option-block-check span {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
    }
}

@media (max-width: 575.98px) {
    .ph-stacked-sections {
        gap: 1.5rem;
    }
    
    .ph-section-block {
        border-radius: 10px;
    }
    
    .ph-section-title {
        font-size: 0.95rem;
        margin-bottom: 0.875rem;
    }
    
    .ph-conditions-grid .form-check {
        padding: 0;                 /* keep clean look on small screens */
        margin-bottom: 0.5rem;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    
    .ph-conditions-grid .form-check-label {
        font-size: 0.85rem;
        line-height: 1.25;
    }
    
    .option-block-radio,
    .option-block-check {
        padding: 0.625rem !important;
    }
    
    .option-block-radio span,
    .option-block-check span {
        font-size: 0.85rem !important;
        line-height: 1.25 !important;
    }
}

/* Enhance readability */
.ph-section-block label.form-check-label, 
.ph-section-block .form-label, 
.ph-section-block .option-block-radio span, 
.ph-section-block .option-block-check span { 
    font-weight:600; 
    color:#111; 
}

/* Fix checkbox alignment and styling for Personal History Medical Conditions */
.ph-section-block .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ph-section-block .form-check-input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    margin-right: 0;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    background-color: #fff;
    background-image: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
}

.ph-section-block .form-check-input[type="checkbox"]:checked {
    background-color: #dc2626;
    border-color: #dc2626;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.ph-section-block .form-check-input[type="checkbox"]:focus {
    border-color: #dc2626;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(220, 38, 38, 0.25);
}

.ph-section-block .form-check-label {
    flex: 1;
    line-height: 1.4;
    cursor: pointer;
    margin-bottom: 0;
}

/* Reuse existing option-block styles but ensure stronger contrast */
.option-block-radio, .option-block-check { backdrop-filter:blur(4px); }
.option-block-radio span, .option-block-check span { color:#222; }

/* Legacy subtab classes kept minimally in case of cached assets (now inert) */
.ph-subtab-nav, .ph-subtab-content { display:none !important; }

/* Additional Questions vertical radio blocks */
.ph-single-question .ph-option-vertical { display: flex; flex-direction: column; gap: 0.75rem; }
.option-block-radio { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; background: rgba(255,255,255,0.04); cursor: pointer; transition: background .25s, border-color .25s; }
.option-block-radio:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.35); }
.option-block-radio input[type=radio] { margin:0; }
.option-block-radio span { font-size: .9rem; font-weight: 500; }
.option-block-radio:has(input[type=radio]:checked) { background:rgba(255,255,255,0.12); border-color:#dc2626; box-shadow:0 0 0 1px rgba(220,38,38,0.35); }
.option-block-check { display:flex; align-items:flex-start; gap:.65rem; padding:.75rem 1rem; border:1px solid rgba(255,255,255,0.18); border-radius:10px; background:rgba(255,255,255,0.05); cursor:pointer; transition:background .25s,border-color .25s, box-shadow .25s; }
.option-block-check:hover { background:rgba(255,255,255,0.11); border-color:rgba(255,255,255,0.35); }
.option-block-check input[type=checkbox]{ margin-top:4px; }
.option-block-check span { font-size:.82rem; line-height:1.1rem; font-weight:500; }
.option-block-check:has(input[type=checkbox]:checked){ background:rgba(255,255,255,0.12); border-color:#dc2626; box-shadow:0 0 0 1px rgba(220,38,38,0.35); }
/* Custom minimal tick styling */
.option-block-check input[type=checkbox],
.option-block-radio input[type=radio]{ accent-color:#dc2626; }

/* === CRITICAL TABLET RESPONSIVE FIX === */
@media (min-width: 481px) and (max-width: 991px) {
    .form-section .col-md-6,
    .form-section .col-md-4,
    .form-section .col-md-3 {
        flex: 0 0 48% !important;
        max-width: 48% !important;
        width: 48% !important;
        display: inline-block !important;
        vertical-align: top !important;
        margin-bottom: 1rem !important;
        margin-right: 2% !important;
    }
    
    .form-section .col-md-6:nth-child(2n),
    .form-section .col-md-4:nth-child(2n),
    .form-section .col-md-3:nth-child(2n) {
        margin-right: 0 !important;
    }
    
    .form-section .col-md-8,
    .form-section .col-md-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 1rem !important;
    }
    
    .form-section .row {
        display: block !important;
        margin: 0 !important;
    }
    
    .form-section .row::after {
        content: "";
        display: table;
        clear: both;
    }
}