/* assets/css/survey.css */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #0284c7;
    --primary-dark: #0369a1;
    --primary-light: #e0f2fe;
    --surface-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    --shadow-card: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--surface-bg);
    color: var(--text-main);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
}

.survey-wrapper {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

/* Header & Branding */
.survey-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 38px 24px 34px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.survey-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
}

.survey-logo {
    max-height: 85px;
    max-width: 240px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto 16px;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.survey-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.35;
    text-align: center;
}

.survey-subtitle {
    font-size: 1rem;
    color: #cbd5e1;
    font-weight: 500;
    margin-bottom: 0;
    text-align: center;
    direction: ltr;
}

/* Intro Card */
.intro-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
}

.intro-text {
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 16px;
    line-height: 1.7;
}

.intro-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    background: #f1f5f9;
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.meta-item {
    font-size: 0.85rem;
    color: #475569;
}

.meta-item strong {
    color: #0f172a;
    display: block;
    margin-bottom: 2px;
}

/* Progress Bar */
.progress-container {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 12px;
    z-index: 99;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.88rem;
    font-weight: 600;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Section Wizard */
.wizard-section {
    display: none;
}

.wizard-section.active {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

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

.section-banner {
    background: #ffffff;
    border-right: 4px solid var(--primary-color);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-right-width: 4px;
    box-shadow: var(--shadow-soft);
}

.section-banner-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.section-banner-en {
    font-size: 0.8rem;
    color: var(--text-muted);
    direction: ltr;
    display: inline-block;
    margin-top: 2px;
}

/* Question Cards */
.question-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.question-card:hover {
    border-color: #cbd5e1;
}

.question-card.has-error {
    border-color: #ef4444;
    background-color: #fffaf0;
}

.question-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.q-badge {
    background: #e2e8f0;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 2px;
}

.q-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.45;
}

.q-required {
    color: #ef4444;
    margin-right: 4px;
}

.q-help {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Option Cards (Radios and Checkboxes) */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-card {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    user-select: none;
}

.option-card:hover {
    border-color: #94a3b8;
    background-color: #f8fafc;
}

.option-card.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.option-input {
    margin-left: 12px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.option-text {
    font-size: 0.95rem;
    color: inherit;
    flex-grow: 1;
}

/* Other Input Field */
.other-input-wrapper {
    margin-top: 10px;
    display: none;
}

.other-input-wrapper.show {
    display: block;
}

.other-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s;
}

.other-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

/* Form Controls */
.text-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.text-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

/* Navigation Buttons */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
}

.btn-nav {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-prev {
    background: #e2e8f0;
    color: #334155;
}

.btn-prev:hover {
    background: #cbd5e1;
}

.btn-next, .btn-submit {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.btn-next:hover, .btn-submit:hover {
    background: var(--primary-dark);
}

.btn-submit {
    background: #059669;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-submit:hover {
    background: #047857;
}

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

/* Error Toast / Alert */
.error-notice {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: none;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Contact Form Grid */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .survey-title {
        font-size: 1.35rem;
    }
    .survey-header {
        padding: 24px 20px;
    }
}
