/* Darkmode Transition */
html.theme-transitioning * {
    transition: 
        background-color 0.3s ease, 
        color 0.3s ease, 
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        fill 0.3s ease,
        stroke 0.3s ease !important;
}

html.theme-transitioning *::before,
html.theme-transitioning *::after {
    transition: 
        background-color 0.3s ease, 
        color 0.3s ease, 
        border-color 0.3s ease,
        box-shadow 0.3s ease !important;
}
/* Dark Mode Transition*/

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    flex: 1;
    text-align: left;
}

.footer-center {
    flex: 1;
    text-align: center;
}

.footer-right {
    flex: 1;
    text-align: right;
}

.wrapper {
}

.content-wrapper {
    padding-top: 6rem;
    padding-bottom: 7.5rem;
}

.header {
    width: 100%;
    position: fixed;
}

.footer {
    width: 100%;
    padding: 0.5rem;
    bottom: 0;
    position: fixed;
}

.content {
    padding-left: 2rem;
    padding-right: 2rem;
}

.hidden {
    visibility: hidden;
    display: none;
}

.text-pom {
    color: #c0392b !important;
}

    .text-pom::after {
        content: "\a";
        white-space: pre;
    }

    .text-pom.hidden {
        height: 0px;
        visibility: hidden;
        display: none;
    }


/* CSS Variables for theming */
:root {
    --wizard-bg-light: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --wizard-bg-dark: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    --card-bg-light: #ffffff;
    --card-bg-dark: #2d3748;
    --section-bg-light: #f8f9fa;
    --section-bg-dark: #1a202c;
    --border-color-light: #dee2e6;
    --border-color-dark: #4a5568;
    --text-primary-light: #0056b3;
    --text-primary-dark: #63b3ed;
    --required-note-bg-light: #fff3cd;
    --required-note-bg-dark: #744210;
    --required-note-border-light: #ffc107;
    --required-note-border-dark: #d69e2e;
}

/* Light mode (default) */
[data-bs-theme="light"] {
    --wizard-bg: var(--wizard-bg-light);
    --card-bg: var(--card-bg-light);
    --section-bg: var(--section-bg-light);
    --border-color: var(--border-color-light);
    --text-primary: var(--text-primary-light);
    --required-note-bg: var(--required-note-bg-light);
    --required-note-border: var(--required-note-border-light);
}

/* Dark mode */
[data-bs-theme="dark"] {
    --wizard-bg: var(--wizard-bg-dark);
    --card-bg: var(--card-bg-dark);
    --section-bg: var(--section-bg-dark);
    --border-color: var(--border-color-dark);
    --text-primary: var(--text-primary-dark);
    --required-note-bg: var(--required-note-bg-dark);
    --required-note-border: var(--required-note-border-dark);
}

/* Wizard container background */
.wizard-wrapper {
    background: var(--wizard-bg);
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
    margin: -20px -12px;
}

[data-bs-theme="dark"] .wizard-wrapper {
    background: var(--wizard-bg-dark);
}

/* Wizard card */
.wizard-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

[data-bs-theme="dark"] .wizard-card {
    background: var(--card-bg-dark);
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

/* Wizard header */
.wizard-header h1 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

[data-bs-theme="dark"] .wizard-header h1 {
    color: var(--text-primary-dark);
}

.wizard-header p {
    color: var(--bs-secondary-color);
}

/* Form section titles */
.form-section-title {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--text-primary);
}

    .form-section-title:first-of-type {
        margin-top: 0;
    }

/* Required note box */
.required-note {
    background: var(--required-note-bg);
    border-left: 4px solid var(--required-note-border);
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
}

[data-bs-theme="dark"] .required-note {
    color: #faf089;
}

/* Wizard buttons */
.wizard-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.btn-wizard {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 6px;
}

/* Therapy section */
.therapy-section {
    background: var(--section-bg);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--text-primary);
}

/* Conditional fields */
.conditional-fields {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

/* Concern sections */
.concern-section {
    background: var(--section-bg);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid #6c757d;
}

    .concern-section.has-concerns {
        border-left-color: var(--text-primary);
    }

[data-bs-theme="dark"] .concern-section.has-concerns {
    background: #2c3e50;
}

.concern-section .conditional-fields {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
}

/* Review sections */
.review-section {
    background: var(--section-bg);
    border-left: 4px solid var(--text-primary);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

    .review-section h5 {
        color: var(--text-primary);
    }

.review-field {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

    .review-field:last-child {
        border-bottom: none;
    }

/* Upload areas */
.upload-row {
    background: var(--section-bg);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid var(--text-primary);
}

.uploaded-file {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

/* Checklist items */
.checklist-item {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

    .checklist-item.complete {
        background: #d4edda;
        color: #155724;
    }

    .checklist-item.incomplete {
        background: #f8d7da;
        color: #721c24;
    }

[data-bs-theme="dark"] .checklist-item.complete {
    background: #1c4532;
    color: #9ae6b4;
}

[data-bs-theme="dark"] .checklist-item.incomplete {
    background: #742a2a;
    color: #feb2b2;
}

/* Hero section on home page */
.hero-section {
    background: var(--wizard-bg-light);
    color: white;
    padding: 50px 0;
    margin: -20px -15px 40px -15px;
    border-radius: 0 0 20px 20px;
}

[data-bs-theme="dark"] .hero-section {
    background: var(--wizard-bg-dark);
}

/* Content sections */
.content-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

[data-bs-theme="dark"] .content-section {
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.content-section h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

[data-bs-theme="dark"] .content-section h2 {
    border-bottom-color: var(--text-primary-dark);
}

/* Required docs list */
.required-docs-list {
    background: var(--section-bg);
    border-left: 4px solid var(--text-primary);
    padding: 20px 20px 20px 30px;
    border-radius: 8px;
    margin: 15px 0;
}

/* Important notes */
.important-notes {
    background: var(--required-note-bg);
    border-left: 4px solid var(--required-note-border);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

[data-bs-theme="dark"] .important-notes {
    color: #faf089;
}

/* Contact box */
.contact-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    margin: 25px 0;
}

[data-bs-theme="dark"] .contact-box {
    background: linear-gradient(135deg, #1a365d 0%, #322659 100%);
}

/* Thank you box */
.thank-you-box {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

[data-bs-theme="dark"] .thank-you-box {
    background: linear-gradient(135deg, #1c4532 0%, #22543d 100%);
}

/* Card actions on home page */
.card-action {
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

    .card-action:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    }

[data-bs-theme="dark"] .card-action:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* Milestone grid */
.milestone-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* Checkbox grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Calendar specific */
.calendar-day {
    position: relative;
    overflow-y: auto;
}

.bg-light-blue {
    background-color: #e3f2fd !important;
}

[data-bs-theme="dark"] .bg-light-blue {
    background-color: #1a365d !important;
}

/* Wizard progress bar dark mode */
[data-bs-theme="dark"] .wizard-progress {
    background: var(--card-bg-dark);
}

[data-bs-theme="dark"] .step-circle {
    background: #4a5568;
    border-color: #4a5568;
    color: #a0aec0;
}

[data-bs-theme="dark"] .step.active .step-circle {
    background: #4299e1;
    border-color: #4299e1;
    box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.3);
}

[data-bs-theme="dark"] .step.completed .step-circle {
    background: #48bb78;
    border-color: #48bb78;
}

[data-bs-theme="dark"] .step-connector {
    background: #4a5568;
}

    [data-bs-theme="dark"] .step-connector.completed {
        background: #48bb78;
    }

/* Form controls in dark mode */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

    [data-bs-theme="dark"] .form-control:focus,
    [data-bs-theme="dark"] .form-select:focus {
        background-color: #2d3748;
        border-color: #4299e1;
        color: #e2e8f0;
    }

/* Input group text */
[data-bs-theme="dark"] .input-group-text {
    background-color: #4a5568;
    border-color: #4a5568;
    color: #e2e8f0;
}

/* Tables in dark mode */
[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--card-bg-dark);
    --bs-table-border-color: var(--border-color-dark);
}

/* Smooth theme transition */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *:before,
html.theme-transitioning *:after {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}

/* ============================================
   Wizard Container (consolidated from step views)
   ============================================ */
.wizard-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Birth weight (Step 3) lbs/oz inputs: keep a minimum input width so the
   number and its spinner arrows stay visible and don't collapse on entry. */
.birth-weight-part {
    min-width: 60px;
}

/* Wizard header centering */
.wizard-header {
    text-align: center;
    margin-bottom: 30px;
}

/* Info card (Step 4 hearing/vision) */
.info-card {
    background: var(--section-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-card .card-header {
    background: var(--bs-secondary-bg);
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
}

.info-card .card-body {
    padding: 15px;
}

/* Care section (Step 5 preschool) */
.care-section {
    background: var(--section-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.care-section.active {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

/* Disclosure items (Step 8) */
.disclosure-item {
    background: var(--section-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.disclosure-item.acknowledged {
    border-color: var(--bs-success);
    background: var(--bs-success-bg-subtle);
}

.disclosure-item .disclosure-text {
    margin-bottom: 15px;
    line-height: 1.6;
}

.disclosure-item .form-check {
    padding-left: 2rem;
}

.disclosure-item .form-check-input {
    width: 1.5em;
    height: 1.5em;
    margin-top: 0;
}

.disclosure-item .form-check-label {
    font-weight: 600;
    color: var(--bs-success);
    padding-left: 0.5rem;
}

/* File icon (Step 9) */
.file-icon {
    font-size: 2rem;
    margin-right: 15px;
}

.file-icon.pdf {
    color: var(--bs-danger);
}

.file-icon.image {
    color: var(--bs-success);
}

.file-icon.doc {
    color: var(--bs-primary);
}

/* Submit button (Step 9) */
.btn-submit {
    background: var(--bs-success);
    border: none;
    color: white;
    padding: 15px 40px;
    font-size: 1.2rem;
}

.btn-submit:hover {
    background: var(--bs-success);
    filter: brightness(1.1);
    color: white;
}

.btn-submit:disabled {
    background: var(--bs-secondary);
    cursor: not-allowed;
}

/* All-acknowledged state (Step 8) */
.all-acknowledged {
    background: var(--bs-success-bg-subtle);
    border-left: 4px solid var(--bs-success);
    padding: 15px;
    border-radius: 4px;
}

/* Important note (Step 8) */
.important-note {
    background: var(--bs-danger-bg-subtle);
    border-left: 4px solid var(--bs-danger);
    padding: 15px;
    margin-top: 25px;
    border-radius: 4px;
}

/* Dismissal fields (Step 5) */
.dismissal-fields {
    display: none;
    margin-top: 15px;
    background: var(--section-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--bs-warning);
}

/* Yes/No select width */
.yes-no-select {
    max-width: 100px;
}

/* Review page styles */
.review-label {
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.review-value {
    color: var(--bs-body-color);
}

.review-value.empty {
    color: var(--bs-secondary-color);
    font-style: italic;
}

.edit-link {
    font-size: 0.9rem;
    text-decoration: none;
}

.final-note {
    background: var(--bs-info-bg-subtle);
    border-left: 4px solid var(--bs-info);
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
}

.review-section h5 {
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Uploaded file row (Step 9) */
.uploaded-file {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.uploaded-file.required {
    border-left: 4px solid var(--bs-success);
}

/* Upload area drag state */
.upload-row.dragover {
    border-color: var(--bs-success);
    background: var(--bs-success-bg-subtle);
}

/* ============================================
   Wizard Progress Bar
   ============================================ */
.wizard-progress {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    padding: 25px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.wizard-progress .progress-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    margin: 0 auto;
    flex-wrap: nowrap;
}

.wizard-progress .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 0 0 auto;
}

.wizard-progress .step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    transition: all 0.3s;
    border: 3px solid var(--bs-secondary-bg);
    text-decoration: none;
}

.wizard-progress .step-link {
    cursor: pointer;
    text-decoration: none;
}

.wizard-progress .step-link:hover .step-circle {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.wizard-progress .step-link:hover .step-label {
    color: var(--bs-success);
    text-decoration: underline;
}

.wizard-progress .step.active .step-circle {
    background: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.2);
}

.wizard-progress .step.completed .step-circle {
    background: var(--bs-success);
    color: white;
    border-color: var(--bs-success);
}

.wizard-progress .step-label {
    font-size: 10px;
    color: var(--bs-secondary-color);
    text-align: center;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.3s;
}

.wizard-progress .step.active .step-label {
    color: var(--bs-primary);
    font-weight: 600;
}

.wizard-progress .step.completed .step-label {
    color: var(--bs-success);
}

.wizard-progress .step-connector {
    flex: 1 1 auto;
    height: 3px;
    background: var(--bs-secondary-bg);
    margin: 0 3px;
    margin-bottom: 28px;
    transition: all 0.3s;
    min-width: 15px;
}

.wizard-progress .step-connector.completed {
    background: var(--bs-success);
}

/* Italic styling for "Does not apply" labels is handled by .fst-italic */

/* Error message for checkbox groups */
[id$="-error"] {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Tablet */
@media (max-width: 992px) {
    .wizard-progress {
        padding: 15px 8px;
    }

    .wizard-progress .step-circle {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    .wizard-progress .step-label {
        font-size: 8px;
    }

    .wizard-progress .step-connector {
        min-width: 8px;
        margin: 0 2px;
        margin-bottom: 22px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .wizard-progress .step-label {
        display: none;
    }

    .wizard-progress .step-connector {
        margin-bottom: 8px;
    }

    .wizard-progress .step-circle {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
}

/* Review section headings (h2 after consolidation) */
.review-section h2 {
    color: var(--text-primary);
    font-size: 1.2rem;
}

/* ============================================
   Accessibility Styles (WCAG 2.1 AA)
   ============================================ */

/* Skip navigation link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--bs-primary);
    color: #fff;
    padding: 8px 16px;
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--bs-warning);
    outline-offset: 2px;
}

/* Enhanced focus-visible for all interactive elements */
*:focus-visible {
    outline: 3px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Live region for screen reader announcements */
.sr-announcer {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Step 9: Document Upload Cards */
.doc-category-card {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    background: var(--bs-body-bg);
}

.doc-category-card:hover,
.doc-category-card:focus-visible {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.15rem rgba(var(--bs-primary-rgb), 0.2);
}

.doc-category-card.complete {
    border-style: solid;
    border-color: var(--bs-success);
    background: rgba(var(--bs-success-rgb), 0.04);
}

.doc-category-card.incomplete {
    border-color: var(--bs-danger);
}

.doc-category-card.optional {
    border-color: var(--bs-border-color);
    border-style: dashed;
}

.doc-category-card.optional.has-files {
    border-style: solid;
    border-color: var(--bs-success);
    background: rgba(var(--bs-success-rgb), 0.04);
}

.doc-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

.doc-category-files {
    border-top: 1px solid var(--bs-border-color);
    padding: 0.5rem 1rem;
    background: rgba(var(--bs-secondary-rgb), 0.03);
}

.doc-file-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
}

.doc-file-row + .doc-file-row {
    border-top: 1px solid rgba(var(--bs-border-color-rgb, 0, 0, 0), 0.1);
}

.file-icon-sm {
    font-size: 1.1rem;
}

.file-icon-sm.pdf { color: #dc3545; }
.file-icon-sm.image { color: #0d6efd; }
.file-icon-sm.doc { color: #2b579a; }
