html, body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
}

h1:focus {
    outline: none;
}

* {
    box-sizing: border-box;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: 8px;
    margin: 1rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-container p {
    margin-top: 1rem;
    color: #6c757d;
}

/* ===== SURVEY PAGE STYLES ===== */

/* Body & Layout */
.survey-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #f8f9fc 0%, #eef1f7 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.survey-header {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.survey-logo {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-text {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

.progress-bar-wrapper {
    width: 120px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Content */
.survey-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.survey-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 48px 56px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 20px 40px -8px rgba(99,102,241,0.1);
    border: 1px solid rgba(255,255,255,0.8);
}

/* Session Recovered Notice */
.session-recovered-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    color: #0369a1;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    border: 1px solid #bae6fd;
}

.session-recovered-notice span {
    flex: 1;
}

/* Loop Indicator */
.loop-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
    border: 1px solid #fcd34d;
    border-radius: 12px;
    margin-bottom: 24px;
}

.loop-indicator strong {
    color: #92400e;
}

.loop-badge {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Question Container */
.question-container {
    margin-bottom: 32px;
}

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

.question-number {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #6366f1;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ============================================================================
 * Question component styles (.question-text and below) moved to
 * shared/Pulsify.Survey.Rendering/wwwroot/css/questions.css and served via
 * /_content/Pulsify.Survey.Rendering/css/questions.css — see index.html.
 * Keeping the runtime-only layout/chrome rules (.survey-page, .survey-card,
 * .progress-bar, .session-recovered-notice, .loop-indicator etc.) here.
 * ============================================================================ */

/* Survey navigation buttons (Next / Back / Submit). Lives here, not in the
   shared questions.css, because these target generic Bootstrap-style class
   names (.btn, .btn-primary, .btn-secondary) — leaving them in the shared
   stylesheet bled into the editor's own Bootstrap chrome (device toggles,
   DxPager, etc.) and re-skinned every button on the editor page. */
.btn {
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.btn-secondary {
    border: 2px solid #e2e8f0;
    background: transparent;
    color: #64748b;
}

.btn-secondary:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    padding: 14px 32px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

@media (max-width: 640px) {
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .btn-primary {
        padding: 12px 24px;
    }
}
