/* Copyright © 2026 CampaignComply. All rights reserved. */

/* Form 410 Builder Specific Styles */
/* Extends shared/styles.css with form-specific components */

/* ===== WIZARD CONTAINER ===== */
.wizard-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-xl);
}

/* ===== PROGRESS INDICATOR ===== */
.wizard-progress-header {
    margin-bottom: var(--space-lg);
    padding: var(--space-lg);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    position: relative;
    z-index: 1;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

.progress-step {
    font-weight: var(--font-semibold);
    color: var(--primary);
}

.progress-percentage {
    font-weight: var(--font-bold);
    color: var(--primary);
    font-size: var(--font-size-lg);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #3B5A8F 100%);
    border-radius: var(--radius-full);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(43, 74, 111, 0.3);
}

/* ===== STEP INDICATOR ===== */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3xl);
    position: relative;
    z-index: 2;
    padding: 0 var(--space-md);
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-light);
    z-index: 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    transition: all var(--transition-base);
    cursor: pointer;
}

.wizard-step:hover {
    transform: translateY(-2px);
}

.wizard-step:hover .step-circle {
    box-shadow: 0 4px 12px rgba(43, 74, 111, 0.3);
    transform: scale(1.15);
}

.wizard-step:hover .step-label {
    color: var(--primary);
    font-weight: var(--font-bold);
}

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 4px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--font-size-lg);
    color: var(--text-light);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.wizard-step.active .step-circle {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: scale(1.1);
}

.wizard-step.completed .step-circle {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

.wizard-step.completed .step-circle::before {
    content: '';
    font-size: var(--font-size-xl);
}

.step-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    font-weight: var(--font-medium);
    text-align: center;
    line-height: 1.2;
}

.wizard-step.active .step-label {
    color: var(--primary);
    font-weight: var(--font-bold);
}

/* Compact stepper for 12+ step wizards (Form 460) */
.wizard-steps-compact {
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) transparent;
    padding: 1.25rem 2rem 1rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.wizard-steps-compact::-webkit-scrollbar {
    height: 4px;
}

.wizard-steps-compact::-webkit-scrollbar-track {
    background: transparent;
}

.wizard-steps-compact::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 2px;
}

.wizard-steps-compact .wizard-step {
    cursor: pointer;
    min-width: 95px;
    flex: 0 0 auto;
    overflow: hidden;
}

.wizard-steps-compact .step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--border-medium);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.wizard-steps-compact .wizard-step.active .step-dot {
    background: var(--gradient-primary);
    border-color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(43, 74, 111, 0.2);
}

.wizard-steps-compact .wizard-step.completed .step-dot {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.wizard-steps-compact .wizard-step.skipped .step-dot {
    background: var(--border-light);
    border-color: var(--border-medium);
}

.wizard-steps-compact .step-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-light);
    margin-top: 4px;
    line-height: 1.2;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.wizard-steps-compact .wizard-step.active .step-label {
    color: var(--primary);
    font-weight: var(--font-bold);
    font-size: 0.7rem;
}

.wizard-steps-compact .wizard-step.completed .step-label {
    color: var(--text-secondary);
}

.wizard-steps-compact .wizard-step.skipped .step-label {
    color: var(--border-medium);
}

.wizard-steps-compact::before {
    top: 16px;
    height: 2px;
    /* Span full scrollable width */
    width: max-content;
    min-width: 100%;
}

.wizard-steps-compact .wizard-step:hover .step-dot {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(43, 74, 111, 0.25);
}

.wizard-steps-compact .wizard-step:hover .step-label {
    color: var(--primary);
    font-weight: var(--font-bold);
}

/* Step name display in progress header */
.step-name-display {
    color: var(--text-secondary, #6B7280);
    font-weight: 400;
    font-size: 0.85em;
}

/* Navigation button row */
.navigation-buttons {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    justify-content: space-between;
}

.navigation-buttons .btn-secondary,
.navigation-buttons .btn-primary,
.navigation-buttons .skip-step-btn {
    min-height: 48px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    padding: 0.625rem 1.25rem;
    box-sizing: border-box;
}

/* Skip button and nav group */
.nav-right-group {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.skip-step-btn {
    background: var(--warning-light);
    border: 2px solid var(--warning);
    color: #92400E;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.skip-step-btn:hover {
    border-color: #D97706;
    color: #78350F;
    background: #FDE68A;
}

/* ===== FORM SECTIONS ===== */
.form-section {
    display: none;
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-3xl);
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-light);
    animation: fadeInUp 0.4s ease;
    position: relative;
    z-index: 3;
}

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

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

.section-header-form {
    display: block;
    margin-bottom: var(--space-2xl);
    border-bottom: 3px solid var(--primary-cream);
    padding-bottom: var(--space-lg);
}

.section-header-form h2 {
    color: var(--primary);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-sm);
}

.section-header-form p {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
}

/* ===== FORM GROUPS ===== */
.form-group {
    margin-bottom: var(--space-xl);
}

.form-group label {
    display: block;
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-base);
}

.form-group label.required::after {
    content: ' *';
    color: var(--danger);
    font-weight: var(--font-bold);
}

.form-help-text {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin-top: var(--space-xs);
    line-height: var(--line-height-relaxed);
}

.form-error {
    display: none;
    color: var(--danger);
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    margin-top: var(--space-xs);
}

.form-group.error .form-error {
    display: block;
}

.form-success {
    display: none;
    color: var(--success);
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    margin-top: var(--space-xs);
}

.form-group.success .form-success {
    display: block;
}

/* ===== FORM INPUTS ===== */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--text-primary);
    background: white;
    transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 74, 111, 0.1);
}

.form-group.error .form-input,
.form-group.error .form-select,
.form-group.error .form-textarea {
    border-color: var(--danger);
}

.form-group.success .form-input,
.form-group.success .form-select,
.form-group.success .form-textarea {
    border-color: var(--primary);
    background: rgba(43, 74, 111, 0.02);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: var(--line-height-relaxed);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-light);
}

/* Small width inputs for dates, zips, etc */
.form-input-small {
    max-width: 200px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.form-input-medium {
    max-width: 350px;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ===== FORM GRID ===== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.form-row-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.form-row-three {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-lg);
}

/* ===== RADIO & CHECKBOX GROUPS ===== */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    cursor: pointer;
    background: var(--bg-light);
}

.radio-option:hover,
.checkbox-option:hover {
    border-color: var(--primary);
    background: white;
    box-shadow: var(--shadow-sm);
}

.radio-option.selected,
.checkbox-option.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg,
        rgba(43, 74, 111, 0.05) 0%,
        rgba(217, 74, 67, 0.03) 100%);
    box-shadow: var(--shadow-md);
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin-top: 2px;
    flex-shrink: 0;
}

.radio-option-content,
.checkbox-option-content {
    flex: 1;
}

.radio-option-label,
.checkbox-option-label {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    display: block;
    margin-bottom: var(--space-xs);
}

.radio-option-description,
.checkbox-option-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

/* ===== BUTTON GROUPS ===== */
.button-choice-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.button-choice {
    padding: var(--space-xl);
    background: white;
    border: 3px solid var(--border-medium);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-size-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.button-choice:hover {
    border-color: var(--primary);
    background: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.button-choice.selected {
    border-color: var(--primary);
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-lg);
}

.button-choice-title {
    font-weight: var(--font-bold);
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-sm);
}

.button-choice-description {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    opacity: 0.9;
}

.button-choice.selected .button-choice-description {
    opacity: 1;
}

/* ===== CONDITIONAL SECTIONS ===== */
.conditional-section {
    display: none;
    margin-top: var(--space-xl);
    padding: var(--space-xl);
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
}

.conditional-section.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.conditional-section-title {
    font-weight: var(--font-bold);
    color: var(--primary);
    margin-bottom: var(--space-lg);
    font-size: var(--font-size-lg);
}

/* ===== INLINE LOOKUP WIDGETS ===== */
/* Inline lookup tool - hidden by default */
.lookup-widget-inline {
    display: none;
    margin: 1rem 0;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: var(--bg-light);
    animation: fadeInUp 0.3s ease;
}

.lookup-widget-inline.show {
    display: block;
}

/* Clickable lookup trigger link */
.lookup-trigger {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s;
}

.lookup-trigger:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Close button for lookup widget */
.lookup-close-btn {
    float: right;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.lookup-close-btn:hover {
    color: var(--primary);
}

/* ===== DYNAMIC REPEATER ===== */
.repeater-container {
    margin-top: var(--space-lg);
}

.repeater-item {
    background: var(--bg-light);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    position: relative;
}

.repeater-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--border-light);
}

.repeater-item-title {
    font-weight: var(--font-bold);
    color: var(--primary);
    font-size: var(--font-size-lg);
}

.repeater-remove-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-weight: var(--font-semibold);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.repeater-remove-btn:hover {
    background: var(--danger);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.repeater-add-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: white;
    border: 2px dashed var(--primary);
    border-radius: var(--radius-lg);
    color: var(--primary);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    font-size: var(--font-size-base);
}

.repeater-add-btn:hover {
    background: var(--primary);
    color: white;
    border-style: solid;
    box-shadow: var(--shadow-md);
}

/* ===== NAVIGATION BUTTONS ===== */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-3xl);
    padding-top: var(--space-xl);
    border-top: 2px solid var(--border-light);
    gap: var(--space-lg);
}

.btn-nav {
    padding: var(--space-md) var(--space-2xl);
    border-radius: var(--radius-full);
    font-weight: var(--font-bold);
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 140px;
    justify-content: center;
}

.btn-prev {
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--border-medium);
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    border-radius: var(--radius-md);
}

.btn-prev:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-light);
}

.btn-next {
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--border-medium);
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    border-radius: var(--radius-md);
}

.btn-next:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-light);
}

.btn-next:disabled {
    background: var(--border-medium);
    color: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    min-height: 52px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    max-width: 100%;
    text-align: center;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    hyphens: auto;
    font-weight: var(--font-bold);
    transition: all var(--transition-base);
    border: 2px solid transparent;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    position: relative;
    overflow: visible;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary:hover {
    background: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    min-height: 52px;
    background: white;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    max-width: 100%;
    text-align: center;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    hyphens: auto;
    font-weight: var(--font-bold);
    transition: all var(--transition-base);
    border: 2px solid var(--border-medium);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: visible;
    cursor: pointer;
    font-family: inherit;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-light);
}

/* ===== REVIEW SUMMARY ===== */
.review-section {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    border: 2px solid var(--border-light);
}

.review-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--border-medium);
}

.review-section-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-bold);
    color: var(--primary);
}

.review-edit-btn {
    padding: var(--space-sm) var(--space-lg);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: var(--font-semibold);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.review-edit-btn:hover {
    background: var(--primary-red);
    transform: scale(1.05);
}

.review-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-light);
}

.review-item:last-child {
    border-bottom: none;
}

.review-label {
    font-weight: var(--font-medium);
    color: var(--text-secondary);
}

.review-value {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    text-align: right;
}

/* ===== AUTO-SAVE INDICATOR ===== */
.autosave-indicator {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    background: white;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 100;
}

.autosave-indicator.show {
    opacity: 1;
}

.autosave-indicator.saving {
    border-color: var(--warning);
    color: var(--warning);
}

.autosave-indicator.saved {
    border-color: var(--primary);
    color: var(--primary);
    background-color: rgba(43, 74, 111, 0.1);
}

/* ===== VALIDATION BADGE ===== */
.validation-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.validation-badge.valid {
    background: var(--success-light);
    color: var(--success);
}

.validation-badge.invalid {
    background: var(--danger-light);
    color: var(--danger);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .wizard-container {
        padding: var(--space-md);
    }

    .wizard-steps {
        padding: 0;
    }

    /* Shrink compact stepper on tablet */
    .wizard-steps-compact .wizard-step {
        min-width: 70px;
    }

    .wizard-steps-compact .step-dot {
        width: 26px;
        height: 26px;
        border-width: 2px;
    }

    .wizard-steps-compact .step-label {
        font-size: 0.55rem;
    }

    .wizard-steps-compact::before {
        top: 13px;
    }

    .nav-right-group {
        flex-direction: column;
        width: 100%;
    }

    .skip-step-btn {
        width: 100%;
        order: 2;
        text-align: center;
    }

    .nav-right-group .btn-primary {
        width: 100%;
    }

    .wizard-step {
        max-width: 60px;
    }

    .step-circle {
        width: 36px;
        height: 36px;
        font-size: var(--font-size-base);
    }

    .step-label {
        font-size: 0.65rem;
    }

    .form-section {
        padding: var(--space-xl);
    }

    .section-header-form h2 {
        font-size: var(--font-size-2xl);
    }

    .form-row,
    .form-row-two,
    .form-row-three {
        grid-template-columns: 1fr;
    }

    .button-choice-group {
        grid-template-columns: 1fr;
    }

    .form-navigation {
        flex-direction: column;
    }

    .btn-nav {
        width: 100%;
    }

    .review-item {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .review-value {
        text-align: left;
    }

    .autosave-indicator {
        bottom: var(--space-md);
        right: var(--space-md);
        left: var(--space-md);
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: var(--space-md);
    }

    .wizard-step {
        max-width: 40px;
    }

    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .step-label {
        font-size: 0.55rem;
    }

    /* Hide compact stepper on phone — rely on progress bar */
    .wizard-steps-compact {
        display: none;
    }
}

/* ===== VALIDATION ERROR PANEL ===== */
.validation-error-panel {
    display: none;
    background: linear-gradient(135deg, var(--warning-light) 0%, #FDE68A 100%);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease;
}

.validation-error-panel.show {
    display: block;
}

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

.validation-error-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.validation-error-icon {
    font-size: var(--font-size-2xl);
    line-height: 1;
    flex-shrink: 0;
}

.validation-error-title {
    color: var(--warning);
    font-weight: var(--font-bold);
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-xs);
}

.validation-error-description {
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
}

.validation-error-list {
    list-style: none;
    padding: 0;
    margin: var(--space-lg) 0;
}

.validation-error-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    background: white;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--danger);
    transition: all var(--transition-base);
    cursor: pointer;
}

.validation-error-item:hover {
    background: var(--bg-light);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.validation-error-item-icon {
    color: var(--danger);
    font-weight: var(--font-bold);
    flex-shrink: 0;
}

.validation-error-item-text {
    flex: 1;
}

.validation-error-item-label {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.validation-error-item-message {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

.validation-error-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.btn-error-action {
    padding: var(--space-sm) var(--space-lg);
    background: var(--warning);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: var(--font-semibold);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.btn-error-action:hover {
    background: var(--warning);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    filter: brightness(1.1);
}

.btn-error-dismiss {
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--border-medium);
}

.btn-error-dismiss:hover {
    background: var(--bg-light);
    border-color: var(--warning);
    color: var(--warning);
    transform: translateY(-2px);
}

/* ===== ENHANCED FORM STYLING ===== */
.form-section {
    box-shadow: 0 10px 25px rgba(43, 74, 111, 0.08);
    transition: box-shadow var(--transition-base);
}

.form-section:hover {
    box-shadow: 0 15px 35px rgba(43, 74, 111, 0.12);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--primary-light);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(43, 74, 111, 0.1);
}

/* Field-level error message styling */
.field-error-message {
    display: none;
    color: var(--danger);
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    margin-top: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--danger-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--danger);
}

.form-group.error .field-error-message {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

.form-group.error .form-input,
.form-group.error .form-select,
.form-group.error .form-textarea {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.03);
}

.form-group.error .form-input:focus,
.form-group.error .form-select:focus,
.form-group.error .form-textarea:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* ===== COMMITTEE NAMING WIZARD MODAL ===== */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

/* Modal Container */
.modal-container {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--primary-dark);
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--border-light);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal Footer */
.modal-footer {
    padding: 1.5rem 2rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Wizard-Specific Styles */
.naming-wizard-modal .modal-body {
    padding: 2rem 2.5rem;
}

.wizard-section {
    margin-bottom: 1.5rem;
}

.wizard-section h4 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

/* Naming Preview Box */
.naming-preview-box {
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 6px rgba(43, 74, 111, 0.1);
}

/* Naming Examples */
.naming-example {
    background: var(--bg-light);
    border-left: 3px solid var(--success);
    padding: 0.875rem 1.25rem;
    margin: 0.75rem 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    border-radius: 0 4px 4px 0;
    transition: all 0.2s ease;
}

.naming-example:hover {
    background: var(--border-light);
    border-left-color: var(--success-dark);
    transform: translateX(4px);
}

.naming-example strong {
    color: var(--primary);
    display: block;
    margin-bottom: 0.25rem;
}

/* Naming Requirements */
.naming-requirement {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0.875rem 0;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
}

.requirement-icon {
    color: var(--success);
    font-size: 1.4rem;
    font-weight: bold;
    flex-shrink: 0;
    line-height: 1;
}

.naming-requirement div {
    flex: 1;
}

/* Info Box in Wizard */
.modal-body .info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1.25rem;
}

/* Button Styles for Modal */
.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.modal-footer .btn-primary {
    background: var(--primary);
    color: white;
}

.modal-footer .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 74, 111, 0.3);
}

.modal-footer .btn-secondary {
    background: var(--border);
    color: var(--text-secondary);
}

.modal-footer .btn-secondary:hover {
    background: var(--border-medium);
}

/* Wizard Input Field Validation States */
#wizardNameInput {
    transition: all 0.3s ease;
    font-size: 1.1rem;
    padding: 0.875rem;
    border: 2px solid var(--border-medium);
    border-radius: 8px;
}

#wizardNameInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(43, 74, 111, 0.1);
}

/* Valid state - green border */
#wizardNameInput.is-valid {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.02) 0%, rgba(16, 185, 129, 0.05) 100%);
}

#wizardNameInput.is-valid:focus {
    border-color: var(--success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

/* Error state - red border */
#wizardNameInput.has-errors {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.02) 0%, rgba(239, 68, 68, 0.05) 100%);
}

#wizardNameInput.has-errors:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

/* Character counter styling */
#wizardCharCount {
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Wizard live preview styling */
#wizardNameLivePreview {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    min-height: 2rem;
    word-break: break-word;
    line-height: 1.4;
    transition: color 0.2s ease;
}

/* Button disabled state */
.modal-footer .btn-primary:disabled {
    background: var(--border-dark);
    cursor: not-allowed;
    opacity: var(--disabled-opacity);
    transform: none;
}

.modal-footer .btn-primary:disabled:hover {
    background: var(--border-dark);
    box-shadow: none;
    transform: none;
}

/* Responsive Design for Modal */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 90vh;
        border-radius: 8px;
    }

    .modal-header {
        padding: 1.25rem 1.5rem;
    }

    .modal-header h3 {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .naming-wizard-modal .modal-body {
        padding: 1.5rem 1.75rem;
    }

    .modal-footer {
        padding: 1.25rem 1.5rem;
        flex-direction: column-reverse;
    }

    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        width: 100%;
    }

    .naming-example {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .naming-preview-box {
        padding: 1.25rem;
    }
}

/* ===== COMMITTEE NAME WARNING BOX ===== */
.committee-name-warning-box {
    background: linear-gradient(135deg, var(--danger-light) 0%, #FECACA 100%);
    border-left: 5px solid var(--danger);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-top: var(--space-lg);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
    animation: warningPulse 2s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
        border-left-color: var(--danger);
    }
    50% {
        box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
        border-left-color: var(--danger);
    }
}

.committee-name-warning-box strong {
    color: var(--danger);
    font-size: var(--font-size-lg);
    display: block;
    margin-bottom: var(--space-md);
    font-weight: var(--font-bold);
}

.committee-name-warning-box ul {
    margin-left: var(--space-xl);
    margin-top: var(--space-md);
    list-style: disc;
    color: #991B1B;
}

.committee-name-warning-box ul li {
    margin-bottom: var(--space-sm);
    font-weight: var(--font-medium);
    line-height: var(--line-height-relaxed);
}

.committee-name-warning-box .btn-secondary {
    margin-top: var(--space-lg);
    background: white;
    color: var(--danger);
    border-color: var(--danger);
    font-weight: var(--font-bold);
}

.committee-name-warning-box .btn-secondary:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* ===== LOADING STATES ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background: white;
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    text-align: center;
    min-width: 300px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-lg);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-semibold);
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.loading-subtext {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    cursor: not-allowed;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Success message */
.success-message {
    display: none;
    padding: var(--space-lg);
    background: var(--success-light);
    border-left: 4px solid var(--success);
    border-radius: var(--radius-md);
    margin-top: var(--space-lg);
    animation: slideIn 0.3s ease-out;
}

.success-message.active {
    display: block;
}

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

.success-message-text {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--success);
    font-weight: var(--font-semibold);
}

.success-message-text::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    font-weight: var(--font-bold);
}

/* Reduced Motion Support - Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== GOOGLE PLACES AUTOCOMPLETE STYLING ===== */
/*
 * IMPORTANT: Google's gmp-place-autocomplete web component uses Shadow DOM
 * Regular CSS selectors like "gmp-place-autocomplete input" CANNOT penetrate Shadow DOM
 * Must use CSS Custom Properties (CSS variables) which ARE inherited into Shadow DOM
 */
gmp-place-autocomplete {
    width: 100%;
    display: block;

    /* CSS Custom Properties - these penetrate the Shadow DOM boundary */
    --gmp-input-text-color: #1f2937;
    --gmp-input-placeholder-color: var(--border-dark);
    --gmp-input-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --gmp-input-font-size: 1rem;
    --gmp-input-line-height: 1.5;
    --gmp-input-padding: 0.75rem 2.5rem 0.75rem 1rem;
    --gmp-input-background-color: white;
    --gmp-input-border-color: var(--border);
    --gmp-input-border-radius: 0.5rem;
    --gmp-input-border-width: 2px;

    /* Focus state */
    --gmp-input-focus-border-color: var(--primary);
    --gmp-input-focus-outline-color: rgba(43, 74, 111, 0.1);
    --gmp-input-focus-outline-width: 3px;

    /* Icon colors */
    --gmp-icon-color: #6b7280;
}

/* ===== PRINT STYLESHEET ===== */
@media print {
    body * {
        visibility: hidden;
    }

    .review-section,
    .review-section * {
        visibility: visible;
    }

    .review-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white !important;
        border: none !important;
        box-shadow: none !important;
        padding: 20px !important;
    }

    .wizard-progress-header,
    .wizard-steps,
    .wizard-steps-compact,
    .form-navigation,
    .validation-error-panel,
    .autosave-indicator,
    .loading-overlay,
    .no-print {
        display: none !important;
    }

    .review-item {
        page-break-inside: avoid;
    }

    .review-section::after {
        content: "Printed from Campaign Comply - For reference only. Official filing must use generated PDF.";
        display: block;
        margin-top: 20px;
        padding-top: 10px;
        border-top: 1px solid #ccc;
        font-size: 9pt;
        color: #666;
        text-align: center;
    }
}
