/* ==========================================================================
   RAWA Podcast Survey — Stylesheet
   جمعية رواء للإنتاج الإعلامي الرقمي
   ========================================================================== */

:root {
    /* Brand palette — RAWA */
    --teal-50:  #f0fdfa;
    --teal-100: #ccfbf1;
    --teal-300: #5eead4;
    --teal-400: #2dd4bf;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;
    --teal-800: #115e59;
    --teal-900: #134e4a;

    --navy-50:  #f8fafc;
    --navy-100: #f1f5f9;
    --navy-200: #e2e8f0;
    --navy-300: #cbd5e1;
    --navy-400: #94a3b8;
    --navy-500: #64748b;
    --navy-600: #475569;
    --navy-700: #334155;
    --navy-800: #1e293b;
    --navy-900: #0f172a;

    --gold:    #f59e0b;
    --gold-light: #fbbf24;

    --success: #10b981;
    --error:   #ef4444;

    /* Semantic */
    --bg:           #fafbfc;
    --bg-elev:      #ffffff;
    --text:         var(--navy-900);
    --text-muted:   var(--navy-500);
    --border:       var(--navy-200);
    --border-strong: var(--navy-300);
    --primary:      var(--teal-700);
    --primary-hover: var(--teal-800);
    --primary-light: var(--teal-50);

    /* Type */
    --font-base: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    --font-display: 'Cairo', 'Tajawal', sans-serif;

    /* Spacing & radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 9999px;

    /* Shadow */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.05), 0 10px 15px -3px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.10), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
    --shadow-teal: 0 10px 30px -8px rgba(15, 118, 110, 0.35);

    /* Transition */
    --t-fast: 150ms ease;
    --t-mid:  250ms ease;
    --t-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-base);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

.hidden { display: none !important; }
.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ==========================================================================
   Decorative background
   ========================================================================== */
.bg-decoration {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}
.bg-blob-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--teal-300), transparent 70%);
    top: -150px; right: -150px;
}
.bg-blob-2 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--teal-100), transparent 70%);
    bottom: -200px; left: -200px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    padding: 24px 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-mark {
    width: 40px; height: 40px;
    color: var(--primary);
    flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text);
}
.brand-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==========================================================================
   Main + cards
   ========================================================================== */
.main-content {
    padding: 40px 0 60px;
    min-height: calc(100vh - 140px);
}
.card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 40px;
    margin-bottom: 24px;
    display: none;
    animation: cardIn 0.5s var(--t-slow);
}
.card.active { display: block; }
@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Intro card
   ========================================================================== */
.intro-card {
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, var(--teal-50) 100%);
    border: 1px solid var(--teal-100);
}
.intro-icon {
    width: 72px; height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
    color: white;
    border-radius: 18px;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-teal);
    animation: bobble 3s ease-in-out infinite;
}
.intro-icon svg { width: 36px; height: 36px; }
@keyframes bobble {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
.intro-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 800;
    color: var(--navy-900);
    margin-bottom: 14px;
}
.intro-lead {
    font-size: 1.05rem;
    color: var(--navy-700);
    max-width: 560px;
    margin: 0 auto 28px;
    line-height: 1.85;
}
.intro-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}
.feature-item {
    background: white;
    border: 1px solid var(--teal-100);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    color: var(--teal-800);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.feature-icon { font-size: 1.1rem; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--t-mid);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
    background: linear-gradient(135deg, var(--teal-600), var(--teal-700));
    color: white;
    box-shadow: var(--shadow-teal);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 35px -8px rgba(15, 118, 110, 0.5);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--navy-50);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-large {
    padding: 16px 36px;
    font-size: 1.05rem;
    border-radius: var(--radius-pill);
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* Spinner inside submit button */
.btn-spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Progress bar
   ========================================================================== */
.progress-wrapper {
    margin-bottom: 24px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 28px;
}
.progress-bar {
    height: 6px;
    background: var(--navy-100);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 16px;
}
.progress-fill {
    height: 100%;
    width: 25%;
    background: linear-gradient(90deg, var(--teal-500), var(--teal-700));
    border-radius: 999px;
    transition: width var(--t-slow);
}
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}
.progress-step {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--navy-100);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    transition: all var(--t-mid);
}
.progress-step.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}
.progress-step.done {
    background: var(--teal-100);
    color: var(--teal-800);
}
.progress-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

/* ==========================================================================
   Step content
   ========================================================================== */
.step-header { margin-bottom: 32px; }
.step-tag {
    display: inline-block;
    background: var(--teal-50);
    color: var(--teal-800);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.step-tag-optional {
    background: #fef3c7;
    color: #92400e;
}
.step-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}
.step-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.question {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px dashed var(--border);
}
.question:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
.question-label {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    font-size: 1rem;
    line-height: 1.6;
}
.required { color: var(--error); }
.hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-right: 4px;
}

/* ==========================================================================
   Radio & checkbox cards
   ========================================================================== */
.radio-grid, .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.radio-card, .checkbox-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--t-fast);
    user-select: none;
    font-size: 0.92rem;
    line-height: 1.4;
}
.radio-card input, .checkbox-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.radio-card::before, .checkbox-card::before {
    content: "";
    width: 18px; height: 18px;
    flex-shrink: 0;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    transition: all var(--t-fast);
    background: white;
}
.checkbox-card::before { border-radius: 4px; }

.radio-card:hover, .checkbox-card:hover {
    border-color: var(--teal-400);
    background: var(--teal-50);
}
.radio-card:has(input:checked), .checkbox-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--teal-50);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}
.radio-card:has(input:checked)::before {
    border-color: var(--primary);
    border-width: 6px;
}
.checkbox-card:has(input:checked)::before {
    background: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M6.5 11.5l-3-3 1-1 2 2 5-5 1 1z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

/* ==========================================================================
   Inputs / textarea
   ========================================================================== */
input[type="text"], input[type="email"], textarea {
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--t-fast);
    resize: vertical;
}
textarea { min-height: 80px; line-height: 1.7; }
input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}
.input-other {
    margin-top: 12px;
    animation: slideDown var(--t-mid);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Step navigation
   ========================================================================== */
.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    gap: 12px;
}
.step-actions .btn:only-child { margin-right: auto; }

/* ==========================================================================
   Success card
   ========================================================================== */
.success-card {
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, var(--teal-50) 100%);
    border-color: var(--teal-200, var(--teal-100));
    padding: 60px 40px;
}
.success-icon {
    width: 80px; height: 80px;
    margin: 0 auto 24px;
    color: var(--success);
}
.success-circle {
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation: drawCircle 0.6s ease-out forwards;
}
.success-check {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.4s 0.5s ease-out forwards;
}
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

.success-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--navy-900);
    margin-bottom: 12px;
}
.success-message {
    color: var(--navy-600);
    margin-bottom: 28px;
    font-size: 1rem;
    line-height: 1.85;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    background: white;
}

/* ==========================================================================
   Toast / error banner
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 50%;
    transform: translateX(50%) translateY(120%);
    background: var(--navy-900);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    transition: transform var(--t-mid);
    z-index: 100;
    max-width: 90vw;
}
.toast.show { transform: translateX(50%) translateY(0); }
.toast.error { background: var(--error); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 640px) {
    .card { padding: 28px 20px; border-radius: var(--radius-lg); }
    .step-title { font-size: 1.25rem; }
    .intro-title { font-size: 1.5rem; }
    .radio-grid, .checkbox-grid { grid-template-columns: 1fr; }
    .progress-wrapper { padding: 16px 20px; }
    .step-actions { flex-direction: column-reverse; }
    .step-actions .btn { width: 100%; }
    .brand-tag { font-size: 0.7rem; }
}
