
@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;500;600;700;800&display=swap');

:root {
    --green: #075b43;
    --green-dark: #033c2e;
    --green-light: #eaf4ef;
    --gold: #c9a45c;
    --text: #263b32;
    --muted: #84948b;
    --border: #e7eee9;
    --shadow: 0 12px 35px rgba(10,65,47,.07);
}

* {
    box-sizing: border-box;
    min-width: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Alexandria', Tahoma, Arial, sans-serif;
    background:
        radial-gradient(ellipse at 10% 10%, rgba(201,164,92,.09), transparent 30%),
        radial-gradient(ellipse at 90% 35%, rgba(7,91,67,.07), transparent 35%),
        #f5f8f6;
    color: var(--text);
    line-height: 1.9;
}

/* الهيدر */

.header {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 190px;
    padding: clamp(20px, 4vw, 45px) clamp(16px, 7vw, 100px);
    display: flex;
    align-items: center;
    gap: clamp(14px, 3vw, 28px);
    color: white;
    background: linear-gradient(125deg, #022f25, #075b43 55%, #087052);
    box-shadow: 0 12px 35px rgba(3,60,46,.18);
}

.header::before {
    content: "";
    position: absolute;
    width: 350px;
    height: 350px;
    border: 1px solid rgba(234,216,170,.17);
    border-radius: 50%;
    left: -100px;
    top: -190px;
    box-shadow:
        0 0 0 30px rgba(234,216,170,.025),
        0 0 0 65px rgba(234,216,170,.025);
    pointer-events: none;
}

.header img {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: clamp(65px, 10vw, 100px);
    height: clamp(65px, 10vw, 100px);
    object-fit: contain;
    background: white;
    padding: 8px;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
    transition: .3s ease;
}

.header img:hover {
    transform: translateY(-4px);
}

.header-text {
    position: relative;
    z-index: 2;
}

.header h1 {
    margin: 0;
    font-size: clamp(19px, 3vw, 32px);
    font-weight: 800;
    line-height: 1.6;
}

.header p {
    margin: 7px 0 0;
    color: #d8e9df;
    font-size: clamp(11px, 1.5vw, 14px);
    line-height: 1.9;
}

/* المحتوى */

.container {
    width: min(950px, calc(100% - 32px));
    margin: clamp(25px, 5vw, 55px) auto;
}

/* المقدمة */

.intro {
    position: relative;
    overflow: hidden;
    padding: clamp(22px, 4vw, 42px);
    margin-bottom: 25px;
    background: linear-gradient(135deg, #fff, #f7fbf8);
    border: 1px solid rgba(201,164,92,.3);
    border-radius: 23px;
    box-shadow: var(--shadow);
}

.intro::after {
    content: "✦";
    position: absolute;
    left: 20px;
    bottom: -55px;
    color: rgba(201,164,92,.12);
    font-size: 150px;
    pointer-events: none;
}

.intro h2 {
    position: relative;
    z-index: 1;
    color: var(--green);
    font-size: clamp(20px, 3vw, 27px);
    font-weight: 800;
    margin: 0 0 12px;
}

.intro p {
    position: relative;
    z-index: 1;
    color: #64766b;
    margin: 0;
    font-size: clamp(12px, 1.6vw, 14px);
    max-width: 750px;
}

/* الأقسام */

.section {
    width: 100%;
    background: rgba(255,255,255,.96);
    padding: clamp(18px, 3vw, 30px);
    border-radius: 20px;
    margin-bottom: 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: .25s ease;
}

.section h3 {
    color: var(--green);
    font-size: clamp(15px, 2vw, 19px);
    font-weight: 800;
    margin: 0 0 18px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 11px;
}

.section h3::before {
    content: "";
    width: 5px;
    height: 24px;
    flex: 0 0 5px;
    border-radius: 10px;
    background: linear-gradient(var(--gold), #e5cf9c);
}

.section p {
    color: var(--muted);
    font-size: 13px;
}

/* الحقول */

label {
    display: block;
    font-weight: 600;
    margin: 14px 0 8px;
    font-size: clamp(12px, 1.5vw, 14px);
}

select,
textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 14px;
    border: 1px solid #dce7df;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: #fbfdfb;
    transition: .25s ease;
}

select {
    min-height: 50px;
}

select:focus,
textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(7,91,67,.09);
    background: white;
}

textarea {
    resize: vertical;
    min-height: 100px;
    margin-bottom: 12px;
}

.scale {
    color: var(--green);
    background: linear-gradient(110deg, #edf6f0, #f8f5eb);
    padding: 15px;
    border-radius: 13px;
    font-size: clamp(11px, 1.5vw, 13px);
    border: 1px solid #e3ebdf;
    text-align: center;
    overflow-wrap: anywhere;
}

/* الأسئلة */

.question-card {
    width: 100%;
    background: white;
    padding: clamp(17px, 3vw, 26px);
    border-radius: 18px;
    margin-bottom: 17px;
    border: 1px solid var(--border);
    box-shadow: 0 7px 25px rgba(10,65,47,.045);
    transition: .25s ease;
    animation: appear .4s ease both;
}

.question-card h4 {
    margin: 0 0 18px;
    color: #244b3b;
    font-size: clamp(12px, 1.7vw, 15px);
    font-weight: 700;
    line-height: 2;
    overflow-wrap: anywhere;
}

/* خيارات الإجابة */

.options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    min-height: 49px;
    background: #f8faf8;
    border: 1px solid #e8eee9;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 500;
    font-size: clamp(10px, 1.3vw, 12px);
    margin: 0;
    transition: .2s ease;
    text-align: center;
    overflow-wrap: anywhere;
}

.option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--green);
    cursor: pointer;
    flex: 0 0 16px;
}

.option:has(input:checked) {
    color: var(--green);
    background: #e9f5ed;
    border: 1px solid var(--green);
    box-shadow: 0 4px 15px rgba(7,91,67,.09);
    font-weight: 700;
}

@media (hover: hover) {
    .option:hover {
        background: #eef6f0;
        border-color: #a5c4b1;
        transform: translateY(-2px);
    }

    .question-card:hover {
        border-color: rgba(201,164,92,.65);
        box-shadow: 0 12px 30px rgba(10,65,47,.08);
    }
}

/* الأزرار */

button {
    border: none;
    background: linear-gradient(115deg, #075b43, #087455);
    color: white;
    padding: 13px 22px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: .25s ease;
    box-shadow: 0 5px 15px rgba(7,91,67,.13);
    touch-action: manipulation;
}

button:active {
    transform: scale(.98);
}

button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

#submitBtn {
    display: block;
    width: 100%;
    min-height: 56px;
    margin-top: 10px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 14px;
    background: linear-gradient(110deg, #034532, #087653);
}

#formMessage {
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    overflow-wrap: anywhere;
}

/* التذييل */

footer {
    text-align: center;
    padding: 25px 12px;
    margin-top: 30px;
    color: #75877c;
    font-size: 12px;
}

/* لوحة المشاركات */

.dashboard {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f3f7f4;
    padding: clamp(10px, 3vw, 30px);
    -webkit-overflow-scrolling: touch;
}

.dashboard.show {
    display: block;
    animation: fadeIn .25s ease;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: linear-gradient(120deg, #043d2e, #087052);
    color: white;
    padding: clamp(17px, 3vw, 27px);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(3,60,46,.17);
}

.dashboard-header h2 {
    color: white;
    margin: 0;
    font-size: clamp(17px, 2.5vw, 23px);
}

.dashboard-header p {
    margin: 5px 0 0;
    color: #d5e8dc;
    font-size: 12px;
}

.dashboard-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.dashboard-actions button {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: none;
}

.dashboard-actions .close-dashboard {
    background: #a64b4b;
    border-color: transparent;
}

/* الإحصائيات */

.stats {
    margin: 20px 0;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    width: min(245px, 100%);
    display: flex;
    flex-direction: column;
    color: var(--green);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-card span {
    color: var(--muted);
    font-size: 12px;
}

.stat-card strong {
    font-size: 34px;
    font-weight: 800;
}

/* المشاركات */

.response-card {
    width: 100%;
    background: white;
    padding: clamp(16px, 3vw, 27px);
    border-radius: 18px;
    margin-bottom: 19px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow-wrap: anywhere;
    animation: appear .4s ease both;
}

.response-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    margin-bottom: 17px;
}

.response-top h3 {
    margin: 0;
    color: var(--green);
    font-size: 16px;
}

.response-date {
    color: #819087;
    font-size: 11px;
    background: #f3f7f4;
    padding: 6px 11px;
    border-radius: 20px;
}

.response-info {
    background: linear-gradient(110deg, #edf6f0, #f8f6ec);
    padding: 13px 15px;
    border-radius: 12px;
    margin-bottom: 17px;
    overflow-wrap: anywhere;
}

.response-info p {
    margin: 4px 0;
    color: var(--green);
    font-weight: 600;
    font-size: 12px;
}

.response-question {
    padding: 14px 0;
    border-bottom: 1px solid #edf1ed;
}

.response-question strong {
    display: block;
    color: #43594b;
    margin-bottom: 9px;
    font-size: 12px;
    line-height: 2;
}

.answer-value {
    display: inline-block;
    max-width: 100%;
    color: var(--green);
    background: #edf6f0;
    border: 1px solid #e0ece3;
    padding: 6px 13px;
    border-radius: 9px;
    font-weight: 700;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.response-card > h3 {
    color: var(--green);
    font-size: 16px;
    margin-top: 22px;
}

.open-answer {
    background: #fafbf9;
    border-right: 4px solid var(--gold);
    padding: 14px;
    border-radius: 11px;
    margin-top: 11px;
    overflow-wrap: anywhere;
}

.open-answer strong {
    display: block;
    color: var(--green);
    margin-bottom: 6px;
    font-size: 12px;
}

.open-answer p {
    margin: 0;
    color: #66766c;
    font-size: 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 2;
}

.loading {
    text-align: center;
    padding: 30px 15px;
    color: #75877c;
    background: white;
    border-radius: 15px;
    overflow-wrap: anywhere;
}

/* الشاشات المتوسطة */

@media (max-width: 900px) {
    .container {
        width: min(760px, calc(100% - 30px));
    }

    .options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* الجوال */

@media (max-width: 600px) {
    body {
        line-height: 1.8;
    }

    .header {
        min-height: 145px;
        padding: 20px 16px;
        gap: 13px;
    }

    .header img {
        width: 62px;
        height: 62px;
        padding: 6px;
        border-radius: 14px;
    }

    .header h1 {
        font-size: 18px;
    }

    .header p {
        font-size: 10px;
        line-height: 1.8;
    }

    .container {
        width: calc(100% - 24px);
        margin: 22px auto;
    }

    .intro {
        padding: 21px 18px;
        border-radius: 17px;
    }

    .intro h2 {
        font-size: 19px;
    }

    .intro p {
        font-size: 12px;
    }

    .section {
        padding: 18px 15px;
        border-radius: 16px;
        margin-bottom: 15px;
    }

    .section h3 {
        font-size: 15px;
    }

    .scale {
        font-size: 11px;
        line-height: 2;
    }

    .question-card {
        padding: 17px 13px;
        border-radius: 15px;
        margin-bottom: 13px;
    }

    .question-card h4 {
        font-size: 12px;
        margin-bottom: 15px;
    }

    .options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .option {
        min-height: 48px;
        padding: 9px 5px;
        font-size: 10px;
        gap: 5px;
        border-radius: 9px;
    }

    .option input {
        width: 14px;
        height: 14px;
        flex-basis: 14px;
    }

    select,
    textarea {
        font-size: 13px;
        padding: 12px;
    }

    #submitBtn {
        min-height: 53px;
        font-size: 14px;
    }

    footer {
        font-size: 10px;
        padding: 20px 8px;
    }

    .dashboard {
        padding: 9px;
    }

    .dashboard-header {
        padding: 16px 13px;
        border-radius: 14px;
        gap: 13px;
    }

    .dashboard-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-actions button {
        width: 100%;
        padding: 11px 5px;
        font-size: 11px;
    }

    .stat-card {
        width: 100%;
        padding: 16px;
    }

    .response-card {
        padding: 15px 12px;
        border-radius: 14px;
    }

    .response-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .response-top h3 {
        font-size: 14px;
    }

    .response-date {
        font-size: 10px;
    }

    .response-question strong {
        font-size: 11px;
    }

    .answer-value {
        font-size: 10px;
    }
}

/* الجوالات الصغيرة جداً */

@media (max-width: 360px) {
    .header {
        padding: 16px 11px;
        gap: 10px;
    }

    .header img {
        width: 53px;
        height: 53px;
    }

    .header h1 {
        font-size: 16px;
    }

    .header p {
        font-size: 9px;
    }

    .container {
        width: calc(100% - 18px);
    }

    .options {
        grid-template-columns: 1fr;
    }

    .option {
        justify-content: flex-start;
        padding-right: 13px;
        font-size: 11px;
    }

    .intro h2 {
        font-size: 17px;
    }
}

/* الأجهزة اللوحية */

@media (min-width: 601px) and (max-width: 1024px) {
    .container {
        width: min(850px, calc(100% - 45px));
    }

    .options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* الشاشات الكبيرة */

@media (min-width: 1400px) {
    .container {
        width: 1050px;
    }

    .question-card {
        padding: 30px;
    }

    .header {
        padding-right: max(8%, calc((100% - 1250px) / 2));
        padding-left: max(8%, calc((100% - 1250px) / 2));
    }
}

/* تقليل الحركة عند الحاجة */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
