/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #396a93 0%, #2c5474 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(57, 106, 147, 0.3);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-section .firm-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.logo-section .tagline {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
}

.contact-info {
    text-align: right;
    font-size: 0.9rem;
    opacity: 0.95;
}

.contact-info p {
    margin-bottom: 2px;
}

/* Progress Bar */
.progress-container {
    background: white;
    padding: 30px 0;
    border-bottom: 1px solid #e9ecef;
}

.progress-fill-track {
    max-width: 600px;
    margin: 0 auto 20px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #396a93 0%, #4a8ab8 100%);
    border-radius: 3px;
    transition: width 0.22s ease-out;
}

.progress-bar {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    min-width: 100px;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.step-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
    min-height: 2.4em;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transition: color 0.3s ease;
}

.step.active .step-circle {
    background: #396a93;
    color: white;
}

.step.active .step-label {
    color: #396a93;
    font-weight: 600;
}

.step.completed .step-circle {
    background: #28a745;
    color: white;
}

.step.completed .step-label {
    color: #28a745;
}

.step-connector {
    flex: 1;
    height: 2px;
    background: #e9ecef;
    margin: 0 10px;
    margin-top: -12px;
    transition: background 0.3s ease;
}

.step-connector.completed {
    background: #28a745;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 0;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #396a93;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Question Card */
.question-card, .success-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
    margin-bottom: 20px;
}

/* Lead-in retainer disclaimer (first screen) */
.question-card.disclaimer-card {
    border: 1px solid #cbd5e0;
    border-left: 4px solid #2c5282;
    background: linear-gradient(180deg, #f7fafc 0%, #ffffff 72px);
    box-shadow: 0 2px 14px rgba(26, 54, 93, 0.1);
}

.question-card.disclaimer-card .question-text {
    color: #2d3748;
}

.question-card.disclaimer-card .question-section-title {
    color: #1a365d;
    letter-spacing: 0.04em;
    font-size: 0.82rem;
    text-transform: uppercase;
}

/* Contested-case disclaimer */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    padding: 28px 32px;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-dialog h3 {
    margin-top: 0;
    color: #396a93;
    font-size: 1.2rem;
}

#contested-modal-ok {
    margin-top: 20px;
}

.success-post-submit {
    padding-top: 8px;
}

.next-steps-after-submit {
    margin-top: 0.75em;
}

/* Question Content */
.question-content {
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #495057;
    margin-bottom: 20px;
}

.question-text p {
    margin-bottom: 0.8em;
}

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

.question-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #396a93;
    margin-bottom: 0.6em !important;
}

.learn-more {
    margin-top: 15px;
}

.learn-more-btn {
    background: none;
    border: none;
    color: #396a93;
    font-size: 0.9rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}

.learn-more-btn:hover {
    color: #2c5474;
}

.learn-more-content {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #396a93;
    font-size: 0.95rem;
    color: #495057;
}

/* BL-01 children repeater */
.children-repeater {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
}

.children-repeater-rows {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.children-repeater-row {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.children-repeater-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.children-repeater-row-title {
    font-weight: 600;
    color: #396a93;
    font-size: 0.95rem;
}

.btn-remove-child {
    background: transparent;
    border: 1px solid #ced4da;
    color: #6c757d;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-remove-child:hover {
    background: #fff;
    border-color: #adb5bd;
    color: #495057;
}

.btn-add-child {
    margin-top: 16px;
    align-self: flex-start;
}

/* Form Fields */
.form-fields {
    margin-bottom: 30px;
}

.field-group {
    margin-bottom: 25px;
}

.field-help-disclosure {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #495057;
}

.field-help-disclosure summary {
    cursor: pointer;
    color: #396a93;
    font-weight: 500;
}

.field-help-disclosure-body {
    margin-top: 0.5rem;
    line-height: 1.5;
}

.field-label {
    display: block;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.field-label.required::after {
    content: " *";
    color: #dc3545;
}

.field-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.field-input:focus {
    outline: none;
    border-color: #396a93;
    box-shadow: 0 0 0 3px rgba(57, 106, 147, 0.1);
}

.field-input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Radio and Checkbox Groups */
.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option, .checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option:hover, .checkbox-option:hover {
    border-color: #396a93;
    background-color: #f8f9fb;
}

.radio-option.selected, .checkbox-option.selected {
    border-color: #396a93;
    background-color: #f8f9fb;
}

.radio-option input, .checkbox-option input {
    margin: 0;
    transform: scale(1.2);
    accent-color: #396a93;
}

.radio-option label, .checkbox-option label {
    flex: 1;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Select Dropdowns */
.field-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.field-select:focus {
    outline: none;
    border-color: #396a93;
    box-shadow: 0 0 0 3px rgba(57, 106, 147, 0.1);
}

/* Textarea */
.field-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
}

.field-textarea:focus {
    outline: none;
    border-color: #396a93;
    box-shadow: 0 0 0 3px rgba(57, 106, 147, 0.1);
}

/* Navigation */
.navigation {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.nav-spacer {
    flex: 1;
}

.primary-nav {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 120px;
    justify-content: center;
}

.btn-primary {
    background: #396a93;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2c5474;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(57, 106, 147, 0.3);
}

.btn-secondary {
    background: white;
    color: #396a93;
    border: 2px solid #396a93;
}

.btn-secondary:hover:not(:disabled) {
    background: #396a93;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(57, 106, 147, 0.3);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    min-width: 200px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 0.95rem;
}

.submit-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 14px;
    border-radius: 6px;
    margin: 12px 0;
    font-size: 0.95rem;
}

.field-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    font-weight: 500;
}

/* Success Card */
.success-card {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.success-header h2 {
    color: #28a745;
    font-size: 2rem;
    margin-bottom: 10px;
}

.success-header p {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 30px;
}

.success-content {
    margin-bottom: 30px;
}

.success-content p {
    margin-bottom: 25px;
    line-height: 1.7;
    color: #495057;
}

.success-footer .disclaimer {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #396a93;
    font-size: 0.95rem;
    color: #495057;
    text-align: left;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h4 {
    color: #396a93;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-section p {
    line-height: 1.6;
    font-size: 0.9rem;
    opacity: 0.9;
}

.footer-section .disclaimer {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #bdc3c7;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding: 20px;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        text-align: center;
        flex-direction: column;
    }
    
    .contact-info {
        text-align: center;
    }
    
    .logo-section .firm-name {
        font-size: 1.5rem;
    }
    
    .progress-bar {
        flex-direction: column;
        gap: 20px;
    }
    
    .step {
        flex-direction: row;
        min-width: auto;
        width: 100%;
        justify-content: flex-start;
        gap: 15px;
    }

    .step-label {
        min-height: 0;
        justify-content: flex-start;
        text-align: left;
    }
    
    .step-circle {
        margin-bottom: 0;
    }
    
    .step-connector {
        display: none;
    }
    
    .question-card, .success-card {
        padding: 25px;
        margin: 0 10px 20px;
    }
    
    .navigation {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .nav-spacer {
        display: none;
    }
    
    .primary-nav, .navigation {
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .question-card, .success-card {
        padding: 20px;
        margin: 0 5px 20px;
    }
}