/* ========================================
   GET STARTED PAGE STYLES - Fixed nav CSS conflicts 
   Using unified blue theme from global.css
   ======================================== */

/* ========================================
   SIMPLIFIED RADIO BUTTON ISOLATION
   Maximum specificity with minimal styling
   ======================================== */

/* Base radio button styling - ULTRA MAXIMUM SPECIFICITY */
html body div.container form#multiStepForm div.form-group label.radio-label {
    font-weight: normal !important;
    display: inline-flex !important;
    align-items: center !important;
    margin-right: 15px !important;
    cursor: pointer !important;
    padding: 6px 10px !important;
    border-radius: var(--border-radius) !important;
    transition: all 0.3s ease !important;
    border: 1px solid transparent !important;
    background-color: transparent !important;
    color: var(--text-color-dark) !important;
    font-size: 1rem !important;
    line-height: 1.4 !important;
}

/* Radio button hover state - ULTRA MAXIMUM SPECIFICITY */
html body div.container form#multiStepForm div.form-group label.radio-label:hover {
    background-color: rgba(39, 84, 138, 0.1) !important;
    border-color: var(--primary-color) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(39, 84, 138, 0.2) !important;
}

/* Radio input styling - ULTRA MAXIMUM SPECIFICITY */
html body div.container form#multiStepForm div.form-group label.radio-label input[type="radio"] {
    margin-right: 8px !important;
    transform: scale(1.2) !important;
    accent-color: var(--primary-color) !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    appearance: auto !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
}

/* Radio input checked state - ULTRA MAXIMUM SPECIFICITY */
html body div.container form#multiStepForm div.form-group label.radio-label input[type="radio"]:checked {
    accent-color: var(--primary-color) !important;
}

/* Radio label text styling - ULTRA MAXIMUM SPECIFICITY */
html body div.container form#multiStepForm div.form-group label.radio-label span {
    color: inherit !important;
    font-weight: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    text-shadow: none !important;
}

/* Selected state styling - ULTRA MAXIMUM SPECIFICITY */
html body div.container form#multiStepForm div.form-group label.radio-label input[type="radio"]:checked + span {
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

/* ========================================
   SIMPLIFIED ERROR STATE - JUST RED BOX AROUND YES RADIO BUTTON
   ======================================== */

/* Simple red box around "Yes" radio button when in error state */
html body div.container form#multiStepForm div.form-group.error label.radio-label:has(input[value="Yes"]) {
    border: 3px solid #ff0000 !important;
    background-color: transparent !important;
    padding: 8px 12px !important;
    border-radius: var(--border-radius) !important;
    color: var(--text-color-dark) !important;
    font-weight: normal !important;
    text-shadow: none !important;
    font-size: 1rem !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Alternative for browsers without :has() support */
html body div.container form#multiStepForm div.form-group.error label.radio-label input[value="Yes"] + span {
    color: var(--text-color-dark) !important;
    font-weight: normal !important;
}

/* Simple red box around checkbox labels when in error state */
html body div.container form#multiStepForm div.form-group.error label.checkbox-label {
    border: 3px solid #ff0000 !important;
    background-color: transparent !important;
    padding: 8px 12px !important;
    border-radius: var(--border-radius) !important;
    color: var(--text-color-dark) !important;
    font-weight: normal !important;
    text-shadow: none !important;
    font-size: 1rem !important;
    box-shadow: none !important;
    transform: none !important;
}

/* ========================================
   END OF SIMPLIFIED RADIO BUTTON ISOLATION
   ======================================== */

   .container *, .container *::before, .container *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body:not(.admin-body) {
    font-family: var(--font-primary);
    color: var(--text-color-dark);
    background-color: var(--background-light);
    line-height: 1.6;
    padding: 0;
}

.container {
    max-width: 800px;
    width: 100%;
    background-color: var(--background-white);
    padding: 30px 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin: 40px auto;
    box-sizing: border-box;
}

h1, h2 {
    font-family: var(--font-secondary);
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 20px;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; margin-bottom: 30px;}
h3 {
    font-family: var(--font-secondary);
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

/* Progress Bar */
.progress-bar-container { width: 100%; margin-bottom: 30px; }
.progress-bar { display: flex; justify-content: space-between; align-items: center; position: relative; margin-bottom: 10px; }
.progress-bar::before { content: ''; position: absolute; top: 50%; left: 0; transform: translateY(-50%); height: 4px; width: 100%; background-color: #e0e0e0; z-index: 1; }
#progress-line { position: absolute; top: 50%; left: 0; transform: translateY(-50%); height: 4px; background-color: var(--primary-color); z-index: 2; width: 0%; transition: width 0.4s ease; }
.progress-step { display: flex; flex-direction: column; align-items: center; z-index: 3; position: relative; flex: 1; }
.progress-step-circle { width: 30px; height: 30px; background-color: #fff; border: 3px solid #e0e0e0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; transition: all 0.4s ease; }
.progress-step-circle.active { border-color: var(--primary-color); background-color: var(--primary-color); color: var(--text-color-light); }
.progress-step-label { font-size: 0.75rem; color: var(--text-color-dark); margin-top: 5px; text-align: center; }
.progress-step-label.active { color: var(--primary-color); font-weight: bold; }

/* Form Styling */
.form-step { display: none; animation: fadeIn 0.5s; }
.form-step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.form-group { margin-bottom: 20px; }
.form-group.inline-group { display: flex; gap: 15px; }
.form-group.inline-group > div { flex: 1; }
.form-group.inline-group.thirds > div { flex-basis: 30%; }

/* --- NEW: Style reset for fieldset --- */
fieldset.form-group {
    border: none;
    padding: 0;
    margin: 0 0 20px 0; /* Add bottom margin to match other form-groups */
}
/* Use legend as you would a h3 for styling consistency */
fieldset.form-group legend {
    font-family: var(--font-secondary);
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.3rem;
    font-weight: 500;
    width: 100%;
    padding: 0;
}
/* --- End of New Styles --- */

label { display: block; margin-bottom: 8px; font-weight: bold; color: var(--secondary-color); font-size: 0.95rem; }
label.radio-label, label.checkbox-label { 
    font-weight: normal; 
    display: inline-flex; 
    align-items: center; 
    margin-right: 15px; 
    cursor: pointer; 
    padding: 6px 10px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

label.radio-label:hover, label.checkbox-label:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

label.radio-label input, label.checkbox-label input { 
    margin-right: 8px; 
    transform: scale(1.2);
}

/* Custom radio and checkbox styling */
label.radio-label input[type="radio"],
label.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary-color);
}

label.radio-label input[type="radio"]:checked,
label.checkbox-label input[type="checkbox"]:checked {
    accent-color: var(--primary-color);
}

/* Selected state styling */
label.radio-label input:checked + span,
label.checkbox-label input:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}
label.error-label { color: var(--error-color) !important; }

/* Enhanced error styling */
input.error, select.error, textarea.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2) !important;
    background-color: rgba(220, 53, 69, 0.05);
}

input.error:focus, select.error:focus, textarea.error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3) !important;
}

/* Simplified error styling - no outer border, just red box around Yes radio button */
.form-group.error {
    border: none;
    border-radius: var(--border-radius);
    padding: 15px;
    background-color: transparent;
    margin-bottom: 20px;
    position: relative;
}

.form-group.error legend,
.form-group.error label {
    color: var(--text-color-dark) !important;
    font-weight: normal !important;
    text-shadow: none;
    font-size: 1rem;
}

/* Error message for radio/checkbox groups */
.form-group.error .error-message {
    color: #ff0000;
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 8px;
    display: block;
}

/* REMOVED: All lime green styling - now using simplified red box styling for all radio buttons */

/* REMOVED: All complex animations - simplified styling only */

/* Error state for number input wrappers */
.number-input-wrapper input.error {
    border-color: var(--error-color) !important;
    background-color: rgba(217, 83, 79, 0.05);
}

.number-input-wrapper input.error + .number-input-arrows {
    border-left-color: var(--error-color);
    background-color: rgba(217, 83, 79, 0.1);
}

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--input-border-color); border-radius: var(--border-radius); font-family: var(--font-primary); font-size: 1rem; transition: border-color 0.3s ease; background-color: var(--input-background-color); }
input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, input[type="date"]:focus, input[type="number"]:focus, select:focus, textarea:focus { outline: none; border-color: var(--input-focus-border-color); box-shadow: 0 0 0 2px rgba(74, 124, 89, 0.2); }

/* Custom number input with visible arrows - Override any global styles */
.number-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.number-input-wrapper input[type="number"] {
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    appearance: none !important;
    padding-right: 30px; /* Make room for custom arrows */
    width: 100%;
}

.number-input-wrapper input[type="number"]::-webkit-outer-spin-button,
.number-input-wrapper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none !important;
}

.number-input-arrows {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    width: 28px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--input-border-color);
    background-color: #f8f9fa;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    z-index: 10; /* Ensure arrows are above other elements */
}

.number-input-arrow {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    font-size: 12px;
    color: #666;
    transition: background-color 0.2s ease;
    border: none;
    background: transparent;
    padding: 0;
    min-height: 18px; /* Ensure minimum touch target */
}

.number-input-arrow:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
}

.number-input-arrow:active {
    background-color: #dee2e6;
}

.number-input-arrow.up {
    border-bottom: 1px solid var(--input-border-color);
    border-radius: 0 var(--border-radius) 0 0;
}

.number-input-arrow.down {
    border-radius: 0 0 var(--border-radius) 0;
}

.number-input-arrow::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.number-input-arrow.up::before {
    border-bottom: 6px solid currentColor;
}

.number-input-arrow.down::before {
    border-top: 6px solid currentColor;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .number-input-arrows {
        width: 32px; /* Slightly larger for better touch targets */
    }
    
    .number-input-wrapper input[type="number"] {
        padding-right: 34px; /* Adjust for larger arrows */
    }
    
    .number-input-arrow {
        min-height: 22px; /* Larger touch targets on mobile */
        font-size: 14px;
    }
    
    .number-input-arrow::before {
        border-left-width: 5px;
        border-right-width: 5px;
    }
    
    .number-input-arrow.up::before {
        border-bottom-width: 7px;
    }
    
    .number-input-arrow.down::before {
        border-top-width: 7px;
    }
}
textarea { min-height: 80px; resize: vertical; }

.character-count { font-size: 0.8rem; color: #777; text-align: right; margin-top: 3px; height: 1.2em; }
.character-count.hidden { visibility: hidden; }

.btn-group { display: flex; justify-content: space-between; margin-top: 30px; }
.btn { padding: 12px 25px; border: none; border-radius: var(--border-radius); font-family: var(--font-primary); font-size: 1rem; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background-color: var(--primary-color); color: var(--text-color-light); }
.btn-primary:hover { background-color: var(--secondary-color); transform: translateY(-2px); }
.btn-secondary { background-color: #e0e0e0; color: var(--text-color-dark); }
.btn-secondary:hover { background-color: #c7c7c7; transform: translateY(-2px); }
.btn-accent { background-color: var(--accent-color); color: var(--text-color-light); }
.btn-accent:hover { background-color: var(--primary-color-dark); transform: translateY(-2px); }
.btn:disabled { background-color: #ccc; cursor: not-allowed; transform: none; }

/* Submit button specific styling */
.btn[type="submit"], 
.btn.submit-btn {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border: 2px solid var(--primary-color);
    box-shadow: var(--box-shadow-button);
}

.btn[type="submit"]:hover, 
.btn.submit-btn:hover {
    background-color: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}

/* Button icons - fallback for Font Awesome issues */
.btn .fas {
    font-size: 0.9em;
}
/* CSS-only arrow fallbacks */
.btn::before,
.btn::after {
    display: none; /* Hidden by default, shown only when Font Awesome fails */
}
.next-btn::after {
    content: '→';
    margin-left: 4px;
    font-size: 1.1em;
}
.prev-btn::before {
    content: '←';
    margin-right: 4px;
    font-size: 1.1em;
}
/* Hide CSS arrows when Font Awesome is working */
.btn .fas + .btn::before,
.btn .fas + .btn::after {
    display: none;
}

.hidden { display: none !important; }
small { font-size: 0.85rem; color: #555; display: block; margin-top: -12px; margin-bottom: 15px; }

/* Policy Section Styles */
.policy-section { padding: 15px; border: 1px solid #e0e0e0; border-radius: var(--border-radius); margin-bottom: 20px; background-color: #f9f9f9; }
.policy-section h3 { margin-top: 0; border-bottom: 1px solid var(--accent-color); padding-bottom: 5px; }
.policy-section p, .policy-section ul { font-size: 0.95rem; margin-bottom: 10px; }
.policy-section ul { list-style-position: inside; padding-left: 10px; }
.policy-section ul li { margin-bottom: 5px; }

/* Review Summary Styles - RESPONSIVE */
#form-summary {
    margin-top: 20px;
    margin-bottom: 30px;
    padding: 25px 30px;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    background-color: var(--background-light);
}
#form-summary h3 {
    color: var(--secondary-color);
    font-family: var(--font-secondary);
    text-align: left;
    margin-top: 0;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 15px;
    font-size: 1.6rem;
}
.summary-list {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px 25px;
    margin: 0;
    padding: 0;
}
.summary-list dt {
    font-weight: 700;
    color: var(--secondary-color);
    text-align: left;
    font-size: 0.95rem;
    align-self: start;
}
.summary-list dd {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color-dark);
    word-break: break-word;
    border-bottom: none;
    padding-bottom: 0;
}

/* For server messages on submit */
#form-server-message {
    padding: 10px;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: bold;
    border: 1px solid transparent;
}

/* Submission Progress Tracking */
.submission-progress {
    display: none;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    background-color: #f8f9fa;
}

.submission-progress.active {
    display: block;
}

.submission-progress h3 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 1.1rem;
    text-align: center;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-step-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    font-size: 0.95rem;
    color: #666;
    transition: all 0.3s ease;
}

.progress-step-item.active {
    color: var(--primary-color);
    font-weight: bold;
}

.progress-step-item.completed {
    color: var(--secondary-color);
}

.progress-step-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.progress-step-item .progress-step-icon {
    border: 2px solid #ddd;
    background-color: #fff;
    color: #999;
}

.progress-step-item.active .progress-step-icon {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.progress-step-item.completed .progress-step-icon {
    border-color: var(--secondary-color);
    background-color: var(--secondary-color);
    color: white;
}

.progress-step-item.active .progress-step-icon::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
    animation: pulse 1s infinite;
}

.progress-step-item.completed .progress-step-icon::after {
    content: '✓';
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.8); }
}

/* Hide submit button during submission */
.btn.submitting {
    opacity: 0.7;
    pointer-events: none;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .container {
        padding: 20px 25px;
        margin: 20px auto;
    }
    
    .form-group.inline-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group.inline-group.thirds {
        flex-direction: column;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Make summary list single column on mobile */
    .summary-list {
        grid-template-columns: 1fr;
        gap: 8px 0;
    }
    
    .summary-list dt {
        font-weight: 700;
        margin-bottom: 4px;
        border-bottom: 1px solid #e0e0e0;
        padding-bottom: 4px;
    }
    
    .summary-list dd {
        margin-bottom: 15px;
        padding-bottom: 15px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    #form-summary {
        padding: 20px 15px;
    }
    
    #form-summary h3 {
        font-size: 1.4rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px 20px;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    
    .progress-step-label {
        font-size: 0.65rem;
    }
    
    .progress-step-circle {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}