/* Prev/Next/Submit controls, progress bar, and the final submit screen. */

.navigation {
    margin-top: 40px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 16px;
}

.nav-btn {
    background: var(--gradient-primary);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
/* Touch feedback for navigation buttons */
.nav-btn:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
}
.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
.nav-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-input);
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}
.progress-text {
    text-align: center;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.final-section {
    text-align: center;
    display: none;
}
.final-section.active {
    display: block;
}

.submit-btn {
    background: var(--gradient-success);
    color: white;
    padding: 16px 48px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.15em;
    font-weight: 600;
    margin: 24px auto;
    display: block;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.submit-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}
.submit-btn.loading {
    background: var(--gradient-primary);
    color: transparent;
}
.submit-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -12px 0 0 -12px;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
/* Touch feedback for submit button */
.submit-btn:active:not(:disabled) {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}
.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.progress-container {
    display: none;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    text-align: left;
}
.progress-step {
    margin: 10px 0;
    padding: 10px 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95em;
}
.progress-step.pending {
    color: var(--text-muted);
}
.progress-step.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    font-weight: 600;
    border-left: 3px solid var(--accent-primary);
}
.progress-step.completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
    border-left: 3px solid var(--accent-success);
}
.progress-step.failed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
    border-left: 3px solid var(--accent-danger);
}

.success-message {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
    padding: 16px;
    border-radius: 12px;
    margin: 24px 0;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: none;
}

.submit-error-message {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
    padding: 16px;
    border-radius: 12px;
    margin: 24px 0;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: none;
    text-align: start;
    line-height: 1.5;
}

.schema-error-actions {
    margin-top: 24px;
}

/* Main footer styles */
.main-footer {
    margin-top: 40px;
    padding: 25px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.main-branding .developed-by {
    color: var(--text-muted);
    font-size: 0.9em;
    margin: 0 0 5px 0;
}
.main-branding .company-name {
    color: var(--accent-primary);
    font-size: 1.1em;
    font-weight: 700;
    margin: 0 0 5px 0;
}
.main-branding .tagline {
    color: var(--text-muted);
    font-size: 0.8em;
    font-style: italic;
    margin: 0;
}

/* Mobile navigation adjustments */
@media (max-width: 768px) {
    .navigation {
        margin-top: 20px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        padding: 16px 20px;
        box-shadow: 0 -4px 20px var(--shadow-color);
        z-index: 100;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border-color);
    }
    .nav-btn {
        padding: 16px 28px;
        font-size: 1em;
        min-height: 48px;
        flex: 1;
    }
    /* The matching bottom padding that keeps content clear of this fixed
       bar lives on .questionnaire-container in base.css. */

    .progress-bar {
        height: 6px;
        border-radius: 3px;
        margin-bottom: 20px;
    }
    .submit-btn {
        padding: 16px 36px;
        font-size: 1.1em;
        width: 100%;
        max-width: 300px;
        min-height: 52px;
    }
    .success-message {
        padding: 14px;
        margin: 16px 0;
        font-size: 0.95em;
    }
    .main-footer {
        margin-top: 30px;
        padding: 20px 0;
        margin-bottom: 60px; /* Space for sticky nav */
    }
    .main-branding .company-name {
        font-size: 1em;
    }
}

/* Small phone adjustments */
@media (max-width: 375px) {
    .nav-btn {
        padding: 14px 20px;
        font-size: 0.95em;
    }
}
