/*
================================================================
NDCS GRANT APPLICATION - STYLESHEET
================================================================
NDCS Brand Colors:
Primary Palette:
- Midnight: #00306B (primary brand color)
- Ultraviolet: #6650A1 (secondary purple)
- Aquamarine: #00B5B0 (teal accent)
- Raspberry: #E2066F (highlight/accent)
- Mustard: #EB931B (warning/attention)

Secondary Palette:
- Cornflower: #4D90CD (lighter blue)
- Forest: #689C68 (success/positive)

Tints Used:
- Midnight 10%: #D7DAE9
- Midnight 5%: #E8E8F1
- Aquamarine 10%: #E8F5F3
- Aquamarine 20%: #D4EDEA
- Raspberry 10%: #FDE8EB
- Mustard 10%: #FBEDDF

Neutral Grays: #333, #666, #999, #E5E5E5, #F5F5F5
White: #FFFFFF

Accessibility Features:
- WCAG 2.2 AA compliant color contrast (4.5:1 minimum)
- Visible focus states with 3px outline
- Responsive typography with rem units
- Semantic spacing and clear visual hierarchy
================================================================
*/

/* ============================================================
   CSS RESET & BASE STYLES
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #F5F5F5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   SKIP LINK (Accessibility)
   ============================================================ */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #00306B;
    color: #FFFFFF;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 0 0 0.25rem 0;
    font-weight: 600;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #E2066F;
    outline-offset: 2px;
}

/* ============================================================
   CONTAINER & LAYOUT
   ============================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
    background: #FFFFFF;
    color: #333;
    padding: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #00306B;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo-area {
    flex-shrink: 0;
}

.logo {
    display: block;
    max-width: 250px;
    height: auto;
}

.header-text {
    flex-grow: 1;
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #00306B;
}

.header-subtitle {
    font-size: 1rem;
    color: #666;
    font-weight: 400;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-title {
        font-size: 1.5rem;
    }
    
    .header-subtitle {
        font-size: 0.875rem;
    }
    
    .logo {
        max-width: 200px;
    }
}

/* ============================================================
   PROGRESS NAVIGATION
   ============================================================ */

.progress-nav {
    background: #FFFFFF;
    border-bottom: 2px solid #E5E5E5;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-steps {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow-x: auto;
    padding: 0.5rem 0;
    gap: 0.5rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 60px;
    position: relative;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 2px;
    background: #E5E5E5;
    z-index: -1;
}

.progress-step.active,
.progress-step.completed {
    /* Active/completed styling handled by child elements */
}

.progress-step.completed:not(:last-child)::after {
    background: #2E7D32;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E5E5E5;
    color: #595959;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: #00306B;
    color: #FFFFFF;
    transform: scale(1.1);
}

.progress-step.completed .step-number {
    background: #2E7D32;
    color: #FFFFFF;
}

.step-label {
    font-size: 0.75rem;
    text-align: center;
    color: #595959;
    font-weight: 500;
}

.progress-step.active .step-label {
    color: #00306B;
    font-weight: 600;
}

@media (max-width: 768px) {
    .progress-steps {
        justify-content: flex-start;
    }
    
    .progress-step {
        min-width: 50px;
    }
    
    .step-label {
        font-size: 0.625rem;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-content {
    padding: 2rem 0 4rem;
    min-height: calc(100vh - 400px);
}

/* ============================================================
   FORM STRUCTURE
   ============================================================ */

.grant-form {
    background: #FFFFFF;
    border-radius: 0.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.form-step {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .grant-form {
        padding: 1.5rem 1rem;
        border-radius: 0;
    }
}

/* ============================================================
   STEP HEADER
   ============================================================ */

.step-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid #00B5B0;
    position: relative;
}

.step-title {
    font-size: 1.75rem;
    color: #00306B;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.step-description {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

.dandelion-motif {
    position: absolute;
    right: 0;
    top: 0;
    width: 60px;
    height: 60px;
    opacity: 0.3;
}

@media (max-width: 768px) {
    .step-title {
        font-size: 1.5rem;
    }
    
    .dandelion-motif {
        width: 40px;
        height: 40px;
    }
}

/* ============================================================
   INFO BOXES
   ============================================================ */

.info-box {
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid;
}

.info-box h3,
.info-box h4 {
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.info-box p,
.info-box ul,
.info-box ol {
    margin-bottom: 0.75rem;
}

.info-box p:last-child,
.info-box ul:last-child,
.info-box ol:last-child {
    margin-bottom: 0;
}

.info-box ul,
.info-box ol {
    padding-left: 1.5rem;
}

.info-box li {
    margin-bottom: 0.5rem;
}

.info-box-primary {
    background: #E8F5F3;
    border-left-color: #00306B;
}

.info-box-secondary {
    background: #F5F5F5;
    border-left-color: #666;
}

.info-box-accent {
    background: #FDE8EB;
    border-left-color: #E2066F;
}

.note {
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
}

/* ============================================================
   FIELDSETS
   ============================================================ */

.form-fieldset {
    border: none;
    margin: 0 0 2rem 0;
    padding: 0;
}

.fieldset-legend {
    font-size: 1.25rem;
    font-weight: 600;
    color: #00306B;
    margin-bottom: 1.5rem;
    padding: 0;
}

/* ============================================================
   FORM GROUPS & ROWS
   ============================================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ============================================================
   LABELS
   ============================================================ */

.form-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.required-indicator {
    color: #E2066F;
    font-weight: 700;
    margin-left: 0.25rem;
}

.field-hint {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

/* ============================================================
   FORM INPUTS
   ============================================================ */

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #E5E5E5;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-family: inherit;
    color: #333;
    background: #FFFFFF;
    transition: all 0.2s ease;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: #999;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 0;
    border-color: #00B5B0;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #D32F2F;
}

/* Error styling for radio and checkbox groups */
.radio-group.error,
.checkbox-group.error {
    border: 2px solid #D32F2F;
    border-radius: 0.5rem;
    padding: 0.5rem;
    background: #FFEBEE;
}

.radio-group.error .radio-item,
.checkbox-group.error .checkbox-item {
    border-color: #D32F2F;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Input with prefix (e.g., £ symbol) */
.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    pointer-events: none;
}

.input-with-prefix-field {
    padding-left: 2rem;
}

/* ============================================================
   RADIO BUTTONS & CHECKBOXES
   ============================================================ */

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid #E5E5E5;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.radio-item:hover,
.checkbox-item:hover {
    background: #F5F5F5;
    border-color: #999;
}

.radio-item input[type="radio"],
.checkbox-item input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #00306B;
}

.radio-item label,
.checkbox-item label {
    cursor: pointer;
    font-weight: 400;
    flex-grow: 1;
    margin: 0;
}

.radio-item input[type="radio"]:focus,
.checkbox-item input[type="checkbox"]:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

.radio-item:has(input:checked),
.checkbox-item:has(input:checked) {
    background: #D4EDEA;
    border-color: #00306B;
}

.checkbox-declaration {
    border: none;
    padding: 0.5rem 0;
    background: none;
}

.checkbox-declaration:hover {
    background: none;
}

/* ============================================================
   ERROR MESSAGES
   ============================================================ */

.error-message {
    display: none;
    color: #D32F2F;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.error-message.visible {
    display: block;
}

/* Error Summary */
.error-summary {
    background: #FFEBEE;
    border: 3px solid #D32F2F;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.error-summary-title {
    color: #D32F2F;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.error-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-list li {
    margin-bottom: 0.5rem;
}

.error-list a {
    color: #D32F2F;
    text-decoration: underline;
    font-weight: 600;
}

.error-list a:hover {
    color: #B71C1C;
}

.error-list a:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: 2px solid transparent;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 3px;
}

.btn-icon {
    font-size: 1.25rem;
    line-height: 1;
}

/* Primary Button */
.btn-primary {
    background: #00306B;
    color: #FFFFFF;
    border-color: #00306B;
}

.btn-primary:hover {
    background: #566999;
    border-color: #566999;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 48, 107, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
    background: #FFFFFF;
    color: #00306B;
    border-color: #00306B;
}

.btn-secondary:hover {
    background: #00306B;
    color: #FFFFFF;
}

/* Tertiary Button */
.btn-tertiary {
    background: #FFFFFF;
    color: #666;
    border-color: #E5E5E5;
}

.btn-tertiary:hover {
    background: #F5F5F5;
    border-color: #999;
}

/* Submit Button */
.btn-submit {
    background: #2E7D32;
    border-color: #2E7D32;
}

.btn-submit:hover {
    background: #0B613D;
    border-color: #0B613D;
}

.btn:disabled {
    background: #cccccc;
    color: #666666;
    border-color: #cccccc;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================
   FORM ACTIONS
   ============================================================ */

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid #E5E5E5;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .form-actions .btn-secondary {
        order: 2;
    }
    
    .form-actions .btn-primary,
    .form-actions .btn-submit {
        order: 1;
    }
    
    .form-actions .btn-tertiary {
        order: 3;
    }
}

/* ============================================================
   INTRO CONTENT
   ============================================================ */

.intro-content {
    max-width: 700px;
}

.eligibility-preview {
    margin-top: 2rem;
}

.eligibility-preview h3 {
    font-size: 1.25rem;
    color: #00306B;
    margin-bottom: 1rem;
}

.eligibility-preview ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.eligibility-preview li {
    margin-bottom: 0.5rem;
}

/* ============================================================
   ELIGIBILITY RESULT
   ============================================================ */

.eligibility-result {
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-top: 1.5rem;
    font-weight: 600;
}

.eligibility-result.success {
    background: #E7EDE6;
    border: 2px solid #689C68;
    color: #0B613D;
}

.eligibility-result.failure {
    background: #FFEBEE;
    border: 2px solid #D32F2F;
    color: #C62828;
}

/* ============================================================
   REVIEW PAGE
   ============================================================ */

.review-content {
    margin-bottom: 2rem;
}

.review-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #F5F5F5;
    border-radius: 0.5rem;
    border-left: 4px solid #00306B;
}

.review-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #E5E5E5;
}

.review-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #00306B;
    margin: 0;
}

.review-edit-btn {
    background: #FFFFFF;
    color: #00306B;
    border: 2px solid #00306B;
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-edit-btn:hover {
    background: #00306B;
    color: #FFFFFF;
}

.review-edit-btn:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

.review-field {
    margin-bottom: 1rem;
}

.review-field-label {
    font-weight: 600;
    color: #666;
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.25rem;
}

.review-field-value {
    color: #333;
    font-size: 1rem;
}

/* ============================================================
   CONFIRMATION PAGE
   ============================================================ */

.confirmation-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.confirmation-icon {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.confirmation-heading {
    font-size: 2rem;
    color: #00306B;
    font-weight: 700;
    margin-bottom: 2rem;
}

.confirmation-reference {
    background: #E8F5F3;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    border: 2px solid #00B5B0;
}

.reference-label {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.reference-number {
    font-size: 2rem;
    font-weight: 700;
    color: #00306B;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.reference-hint {
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
}

.confirmation-steps {
    text-align: left;
    padding-left: 1.5rem;
}

.confirmation-steps li {
    margin-bottom: 1rem;
}

.support-info {
    text-align: left;
    margin-top: 2rem;
}

.support-info h4 {
    font-size: 1.125rem;
    color: #00306B;
    margin-bottom: 0.75rem;
}

.support-info ul {
    padding-left: 1.5rem;
}

.support-info li {
    margin-bottom: 0.5rem;
}

.demo-note {
    background: #FBEDDF;
    padding: 1rem;
    border-radius: 0.375rem;
    border: 2px solid #EB931B;
    margin-top: 1rem;
    font-weight: 600;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    background: #333;
    color: #FFFFFF;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
}

.footer-text {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-text:last-child {
    margin-bottom: 0;
}

.demo-notice {
    color: #EB931B;
    font-weight: 600;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================================
   RESPONSIVE UTILITIES
   ============================================================ */

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.75rem 1.25rem;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    .skip-link,
    .site-header,
    .progress-nav,
    .form-actions,
    .site-footer {
        display: none;
    }
    
    .grant-form {
        box-shadow: none;
        padding: 0;
    }
    
    .form-step {
        display: block;
        page-break-inside: avoid;
    }
    
    body {
        background: #FFFFFF;
    }
}

/* ============================================================
   CHILD ENTRY CARDS (Multiple Children Support)
   ============================================================ */

.children-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.child-entry {
    background: #FFFFFF;
    border: 2px solid #E5E5E5;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.child-entry:hover {
    border-color: #00306B;
}

.child-entry.expanded {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.child-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E5E5E5;
}

.child-entry-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #00306B;
    margin: 0;
}

.child-entry-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-remove-child {
    background: #dc3545;
    color: #FFFFFF;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-remove-child:hover {
    background: #c82333;
}

.btn-remove-child:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

.btn-remove-child:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-toggle-child {
    background: #00306B;
    color: #FFFFFF;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-toggle-child:hover {
    background: #566999;
}

.btn-toggle-child:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

.child-entry-content {
    display: block;
}

.child-entry-content.collapsed {
    display: none;
}

.child-entry-summary {
    display: none;
    padding: 0.5rem 0;
    color: #666;
    font-style: italic;
}

.child-entry-content.collapsed + .child-entry-summary {
    display: block;
}

.add-child-container {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    border: 2px dashed #E5E5E5;
    border-radius: 8px;
    margin-top: 1rem;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.add-child-container:hover {
    border-color: #00306B;
    background: #E8F5F3;
}

.btn-add-child {
    background: #2E7D32;
    color: #FFFFFF;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s ease;
}

.btn-add-child:hover {
    background: #0B613D;
}

.btn-add-child:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

.btn-add-child:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.child-count-info {
    text-align: center;
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.child-section-divider {
    margin: 2rem 0;
    border: 0;
    border-top: 2px solid #00B5B0;
    position: relative;
}

.child-section-divider::after {
    content: attr(data-section);
    position: absolute;
    top: -0.75rem;
    left: 1rem;
    background: #FFFFFF;
    padding: 0 0.5rem;
    color: #00306B;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ============================================================
   MULTIPLE FUNDING ENTRIES
   ============================================================ */

.funding-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.funding-entry {
    background: #FFFFFF;
    border: 2px solid #E5E5E5;
    border-radius: 8px;
    padding: 1.5rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.funding-entry:hover {
    border-color: #00306B;
}

.funding-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E5E5E5;
}

.funding-entry-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #00306B;
    margin: 0;
}

.funding-entry-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-remove-funding {
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-remove-funding:hover:not(:disabled) {
    background: #dc3545;
    color: #FFFFFF;
}

.btn-remove-funding:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-remove-funding:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

.funding-entry-content {
    display: block;
}

.add-funding-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border: 2px dashed #E5E5E5;
    border-radius: 8px;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.add-funding-container:hover {
    border-color: #00306B;
    background: #E8F5F3;
}

.btn-add-funding {
    background: #2E7D32;
    color: #FFFFFF;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s ease;
}

.btn-add-funding:hover {
    background: #0B613D;
}

.btn-add-funding:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

.btn-add-funding:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .funding-entry {
        padding: 1rem;
    }
    
    .funding-entry-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .funding-entry-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .child-entry {
        padding: 1rem;
    }
    
    .child-entry-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .child-entry-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ============================================================
   HIGH CONTRAST MODE SUPPORT
   ============================================================ */

@media (prefers-contrast: high) {
    .btn {
        border-width: 3px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        border-width: 3px;
    }
}

/* ============================================================
   REDUCED MOTION SUPPORT
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   ADDRESS LOOKUP STYLES
   ============================================================ */

.postcode-lookup-container {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.postcode-lookup-container .form-input {
    flex: 1;
    max-width: 200px;
}

.postcode-lookup-container .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

#addressSelectGroup {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#manualAddressFields {
    padding-top: 0.5rem;
}

/* Style for the manual entry link */
#addressSelectGroup .field-hint a {
    color: #00306B;
    text-decoration: underline;
}

#addressSelectGroup .field-hint a:hover {
    color: #566999;
}

#addressSelectGroup .field-hint a:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

/* Loading state for find address button */
.postcode-lookup-container .btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

@media (max-width: 480px) {
    .postcode-lookup-container {
        flex-direction: column;
    }
    
    .postcode-lookup-container .form-input {
        max-width: 100%;
        width: 100%;
    }
    
    .postcode-lookup-container .btn {
        width: 100%;
    }
}

/* ============================================================
   MODAL DIALOG
   ============================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-container {
    background: #FFFFFF;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    animation: slideIn 0.2s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E5E5E5;
    background-color: #E8E8F1;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #00306B;
    margin: 0;
    padding-right: 1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.modal-close:hover {
    background-color: #E5E5E5;
    color: #333;
}

.modal-close:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

.modal-body {
    padding: 1.5rem;
    color: #333;
    line-height: 1.7;
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-body .modal-highlight {
    background-color: #FBEDDF;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    border-left: 4px solid #EB931B;
    margin: 1rem 0;
}

.modal-body .modal-success {
    background-color: #E8F5E8;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    border-left: 4px solid #689C68;
    margin: 1rem 0;
}

.modal-body .copy-text {
    background-color: #F5F5F5;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.9rem;
    word-break: break-all;
    display: block;
    margin: 0.5rem 0;
    border: 1px solid #E5E5E5;
    user-select: all;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #E5E5E5;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: #F5F5F5;
}

.modal-footer .btn {
    min-width: 100px;
}

@media (max-width: 480px) {
    .modal-container {
        max-width: 100%;
        margin: 0.5rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column-reverse;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Info link style for info boxes */
.info-link {
    color: #00306B;
    text-decoration: underline;
    font-weight: 500;
}

.info-link:hover {
    color: #566999;
}

.info-link:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

/* ============================================================
   SAVE NOTIFICATION TOAST
   ============================================================ */

.save-notification {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9998;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.save-notification-fade {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.save-notification-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #FFFFFF;
    border: 1px solid #689C68;
    border-left: 4px solid #689C68;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 400px;
}

.save-notification-icon {
    color: #689C68;
    font-size: 1.25rem;
    font-weight: bold;
    flex-shrink: 0;
}

.save-notification-text {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
}

.save-notification-text strong {
    color: #00306B;
}

.save-notification-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.save-notification-close:hover {
    color: #333;
}

.save-notification-close:focus {
    outline: 2px solid #00B5B0;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .save-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .save-notification-content {
        max-width: 100%;
    }
}

/* ============================================================
   BSL VIDEO LINK STYLES
   ============================================================ */

.bsl-video-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6650A1;
    background-color: #F5F3FA;
    border: 1px solid #6650A1;
    border-radius: 0.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
    vertical-align: middle;
    white-space: nowrap;
}

.bsl-video-link:hover {
    background-color: #6650A1;
    color: #FFFFFF;
}

.bsl-video-link:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
    background-color: #6650A1;
    color: #FFFFFF;
}

.bsl-video-link .bsl-icon {
    width: 28px;
    height: 13px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Ensure touch target is adequate on mobile (min 44x44px) */
@media (max-width: 768px) {
    .bsl-video-link {
        padding: 0.5rem 0.625rem;
        font-size: 0.875rem;
        min-height: 44px;
        min-width: 44px;
        justify-content: center;
    }
}

/* BSL link inside fieldset legends */
.fieldset-legend .bsl-video-link {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
}

@media (max-width: 768px) {
    .fieldset-legend .bsl-video-link {
        display: inline-flex;
        margin-top: 0.5rem;
        margin-left: 0;
    }
}

/* ============================================================
   BSL VIDEO MODAL STYLES
   ============================================================ */

.bsl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 1rem;
}

.bsl-modal-overlay[aria-hidden="false"] {
    display: flex;
}

.bsl-modal-container {
    background: #FFFFFF;
    border-radius: 0.5rem;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.bsl-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #6650A1;
    color: #FFFFFF;
}

.bsl-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bsl-modal-title .bsl-icon {
    font-size: 1.25rem;
}

.bsl-modal-close {
    background: transparent;
    border: 2px solid transparent;
    color: #FFFFFF;
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.bsl-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.bsl-modal-close:focus {
    outline: none;
    border-color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.2);
}

.bsl-modal-body {
    padding: 0;
    background-color: #000;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bsl-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.bsl-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.bsl-modal-footer {
    padding: 1rem 1.5rem;
    background-color: #F5F5F5;
    border-top: 1px solid #E5E5E5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.bsl-modal-question {
    flex: 1;
    font-size: 0.875rem;
    color: #666;
    min-width: 200px;
}

.bsl-modal-question strong {
    color: #333;
}

.bsl-modal-actions {
    display: flex;
    gap: 0.5rem;
}

.bsl-modal-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bsl-modal-btn-close {
    background-color: #6650A1;
    color: #FFFFFF;
    border: none;
}

.bsl-modal-btn-close:hover {
    background-color: #5540A0;
}

.bsl-modal-btn-close:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

.bsl-modal-btn-external {
    background-color: transparent;
    color: #6650A1;
    border: 1px solid #6650A1;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.bsl-modal-btn-external:hover {
    background-color: #F5F3FA;
}

.bsl-modal-btn-external:focus {
    outline: 3px solid #00B5B0;
    outline-offset: 2px;
}

/* Mobile adjustments for BSL modal */
@media (max-width: 768px) {
    .bsl-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .bsl-modal-container {
        max-height: 85vh;
        border-radius: 1rem 1rem 0 0;
        width: 100%;
    }
    
    .bsl-modal-header {
        padding: 0.875rem 1rem;
    }
    
    .bsl-modal-title {
        font-size: 1rem;
    }
    
    .bsl-modal-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }
    
    .bsl-modal-question {
        text-align: center;
        min-width: auto;
    }
    
    .bsl-modal-actions {
        flex-direction: column;
    }
    
    .bsl-modal-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        min-height: 44px;
    }
}

/* Introductory BSL info banner */
.bsl-info-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background-color: #F5F3FA;
    border: 1px solid #6650A1;
    border-radius: 0.5rem;
    border-left: 4px solid #6650A1;
}

.bsl-info-banner-icon {
    width: 56px;
    height: 26px;
    flex-shrink: 0;
}

.bsl-info-banner-text {
    flex: 1;
}

.bsl-info-banner-text p {
    margin: 0;
    color: #333;
    font-size: 0.9375rem;
}

.bsl-info-banner-text p strong {
    color: #6650A1;
}

@media (max-width: 480px) {
    .bsl-info-banner {
        flex-direction: column;
        text-align: center;
    }
}
