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

:root {
    --bg: #f4f5f0;
    --surface: #ffffff;
    --surface-soft: #f8f9f5;
    --ink: #171a17;
    --muted: #657064;
    --line: #dfe4da;
    --line-strong: #cbd3c4;
    --brand: #93c01f;
    --brand-dark: #5f8511;
    --brand-soft: #edf6d7;
    --danger: #b52828;
    --warning: #9a6500;
    --shadow: 0 16px 45px rgba(28, 39, 22, .08);
    --radius: 18px;
    --sidebar: 320px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: "Tajawal", system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 90% 0%, rgba(147, 192, 31, .10), transparent 28rem),
        var(--bg);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
textarea { resize: vertical; }
::selection { background: var(--brand); color: #101410; }

.topbar {
    height: 76px;
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 28px;
    background: rgba(23, 26, 23, .97);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(14px);
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 43px; height: 43px; border: 2px solid var(--brand); border-radius: 50%;
    display: grid; place-items: center; color: var(--brand); font-weight: 800;
    transform: rotate(-8deg);
}
.brand-mark span { transform: rotate(8deg); }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: .18em; direction: ltr; }
.brand-subtitle { color: #b8c1b4; font-size: 12px; margin-top: 2px; }
.top-actions { display: flex; gap: 8px; }

.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar {
    position: sticky; top: 76px; height: calc(100vh - 76px); overflow-y: auto;
    padding: 28px 22px;
    background: #1b1f1b; color: #fff;
    border-left: 1px solid rgba(255,255,255,.08);
}
.sidebar-head h1 { margin: 8px 0 8px; font-size: 22px; }
.sidebar-head p { margin: 0; color: #aeb8ab; line-height: 1.75; font-size: 13px; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: 12px; letter-spacing: .04em; }

.progress-box {
    margin: 24px 0 18px; padding: 15px; border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px; background: rgba(255,255,255,.04);
}
.progress-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: #aeb8ab; }
.progress-meta strong { color: var(--brand); font-size: 17px; }
.progress-track { height: 7px; margin-top: 10px; background: rgba(255,255,255,.10); border-radius: 10px; overflow: hidden; direction: ltr; }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--brand); transition: width .25s ease; }

.step-nav { display: grid; gap: 5px; }
.step-link {
    appearance: none; border: 0; width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 10px 11px; border-radius: 10px; background: transparent; color: #b9c3b6;
    text-align: right; font-size: 13px; transition: .2s ease;
}
.step-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.step-link span {
    flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center;
    border-radius: 50%; background: rgba(255,255,255,.07); font-size: 11px; font-weight: 700;
}
.step-link.active { background: rgba(147,192,31,.14); color: #fff; }
.step-link.active span { background: var(--brand); color: #172016; }
.step-link.complete span { background: rgba(147,192,31,.2); color: var(--brand); }

.privacy-note {
    margin-top: 20px; padding: 14px; border-radius: 12px; background: rgba(147,192,31,.08);
    border: 1px solid rgba(147,192,31,.17); display: grid; gap: 5px;
}
.privacy-note strong { color: var(--brand); font-size: 13px; }
.privacy-note span { color: #aeb8ab; font-size: 11px; line-height: 1.6; }

.content { min-width: 0; padding: 36px clamp(18px, 4vw, 58px) 60px; }
#requirementsForm { max-width: 1080px; margin: 0 auto; }
.form-step { display: none; animation: fadeUp .22s ease; }
.form-step.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-heading { margin-bottom: 24px; }
.section-kicker { color: var(--brand-dark); font-size: 13px; font-weight: 800; }
.section-heading h2 { margin: 6px 0 8px; font-size: clamp(25px, 3vw, 36px); line-height: 1.25; }
.section-heading p { margin: 0; color: var(--muted); line-height: 1.8; max-width: 760px; }

.hero-card {
    display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 110px); gap: 14px;
    align-items: stretch; padding: 26px; border-radius: 22px;
    background: linear-gradient(125deg, #171a17, #262d23); color: #fff;
    box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden; position: relative;
}
.hero-card::after {
    content: ""; position: absolute; inset: auto -40px -70px auto; width: 210px; height: 210px;
    border: 32px solid rgba(147,192,31,.12); border-radius: 50%;
}
.hero-card h3 { margin: 11px 0 7px; font-size: 23px; }
.hero-card p { color: #bec6ba; line-height: 1.7; margin: 0; max-width: 570px; }
.badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: rgba(147,192,31,.16); color: #c9e47a; font-size: 11px; font-weight: 700; direction: ltr; }
.hero-stat {
    min-height: 110px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.05);
    border-radius: 16px; display: grid; place-content: center; text-align: center; position: relative; z-index: 1;
}
.hero-stat strong { font-size: 29px; color: var(--brand); }
.hero-stat span { font-size: 12px; color: #b8c1b4; }

.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 8px; }
.field > span { font-size: 14px; font-weight: 700; }
.field b { color: var(--danger); }
.field input, .field textarea, .question-card textarea {
    width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
    border-radius: 12px; padding: 13px 14px; outline: none; transition: .18s ease;
}
.field input:focus, .field textarea:focus, .question-card textarea:focus {
    border-color: var(--brand); box-shadow: 0 0 0 4px rgba(147,192,31,.12);
}
.field input.invalid, .field textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(181,40,40,.08); }
.field-error { color: var(--danger); min-height: 0; font-size: 12px; }
.field.compact { margin-top: 14px; }
.field.compact > span { font-size: 12px; color: var(--muted); font-weight: 600; }

.info-panel, .submit-note {
    margin-top: 20px; border: 1px solid #d9e7b7; background: var(--brand-soft); border-radius: 15px; padding: 17px 19px;
}
.info-panel strong { color: #4f710c; }
.info-panel ul { margin: 8px 0 0; padding-right: 20px; color: #4f5e43; line-height: 1.9; }

.requirements-list, .questions-list, .documents-list { display: grid; gap: 13px; }
.requirement-card, .question-card, .document-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 7px 25px rgba(30,42,24,.04);
}
.requirement-card { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 14px; padding: 18px; }
.req-number, .question-number, .doc-index {
    width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px;
    background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; font-size: 13px;
}
.req-main h3 { margin: 3px 0 13px; font-size: 15px; line-height: 1.7; }

.segmented { display: flex; flex-wrap: wrap; gap: 7px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
    display: inline-flex; align-items: center; justify-content: center; min-height: 36px;
    padding: 8px 13px; border: 1px solid var(--line); background: var(--surface-soft);
    border-radius: 10px; color: var(--muted); font-size: 12px; font-weight: 700; transition: .18s;
}
.segmented input:checked + span { color: #315000; background: var(--brand-soft); border-color: #b7d762; }
.segmented.small span { min-height: 32px; padding: 6px 10px; font-size: 11px; }

.question-card {
    display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 14px; padding: 19px;
}
.question-card.answered { border-color: #c8dc95; }
.question-content { display: grid; gap: 11px; }
.question-content strong { line-height: 1.75; font-size: 15px; }
.answer-status { color: var(--muted); font-size: 11px; }
.question-card.answered .answer-status { color: var(--brand-dark); font-weight: 700; }

.upload-summary {
    display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 15px; padding: 13px 16px;
    border-radius: 13px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 13px;
}
.upload-summary strong { color: var(--ink); }

.document-card { padding: 18px; }
.doc-head { display: flex; align-items: center; gap: 12px; }
.doc-head h3 { margin: 0; font-size: 15px; line-height: 1.65; }
.doc-controls { margin-top: 15px; }
.upload-zone {
    position: relative; margin-top: 13px; min-height: 86px; display: flex; align-items: center; gap: 13px;
    border: 1.5px dashed var(--line-strong); border-radius: 14px; padding: 14px; background: var(--surface-soft);
    cursor: pointer; transition: .18s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--brand); background: var(--brand-soft); }
.upload-zone.has-file { border-style: solid; border-color: #b7d762; background: #f7fbe9; }
.upload-zone input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.upload-icon { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #fff; color: var(--brand-dark); font-size: 23px; border: 1px solid var(--line); }
.upload-copy { display: grid; gap: 3px; min-width: 0; }
.upload-copy strong { font-size: 13px; overflow-wrap: anywhere; }
.upload-copy small { color: var(--muted); }
.remove-file {
    display: none; position: relative; z-index: 2; margin-right: auto; flex: 0 0 30px; width: 30px; height: 30px;
    border: 0; border-radius: 50%; background: #fff; color: var(--danger); font-size: 20px;
}
.upload-zone.has-file .remove-file { display: grid; place-items: center; }

.review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.review-card {
    padding: 20px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); display: grid; gap: 8px;
}
.review-card span { color: var(--muted); font-size: 13px; }
.review-card strong { font-size: 25px; }
.review-details {
    border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.review-details h3 { margin: 0 0 12px; }
.review-list { display: grid; gap: 9px; }
.review-row { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 9px; border-bottom: 1px dashed var(--line); }
.review-row:last-child { border: 0; padding-bottom: 0; }
.review-row span { color: var(--muted); }
.review-row strong { text-align: left; overflow-wrap: anywhere; }

.declaration {
    display: grid; gap: 10px; padding: 18px; background: #fffaf0; border: 1px solid #ead8ac; border-radius: var(--radius); margin-bottom: 18px;
}
.check-row { display: flex; align-items: flex-start; gap: 10px; line-height: 1.7; }
.check-row input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand-dark); }

.submit-note { display: flex; gap: 11px; align-items: flex-start; color: #4f5e43; }
.submit-note p { margin: 0; line-height: 1.7; }

.form-actions {
    position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
    margin-top: 26px; padding: 14px; border: 1px solid var(--line); border-radius: 16px;
    background: rgba(255,255,255,.92); backdrop-filter: blur(14px); box-shadow: 0 -10px 35px rgba(30,42,24,.08);
}
.action-spacer { flex: 1; }
.btn {
    border: 1px solid transparent; border-radius: 11px; padding: 11px 17px; min-height: 43px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; transition: .18s ease;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #172016; border-color: var(--brand); }
.btn-primary:hover:not(:disabled) { background: #a6d129; transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-soft); }
.btn-ghost { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.10); padding: 8px 12px; min-height: 36px; font-size: 12px; }
.btn-ghost:hover { background: rgba(255,255,255,.11); }
.danger-text { color: #ffb5b5; }
.spinner {
    display: none; width: 17px; height: 17px; border-radius: 50%; border: 2px solid rgba(23,32,22,.25); border-top-color: #172016; animation: spin .7s linear infinite;
}
.submit-btn.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.hp-field { position: fixed !important; left: -9999px !important; opacity: 0 !important; }
.alert { padding: 14px; border-radius: 12px; margin-bottom: 15px; }
.alert.error { background: #fff1f1; color: var(--danger); border: 1px solid #f1c5c5; }

.toast-container { position: fixed; left: 20px; bottom: 20px; z-index: 80; display: grid; gap: 8px; }
.toast {
    min-width: 260px; max-width: 390px; padding: 13px 15px; border-radius: 12px; color: #fff; background: #232a22;
    box-shadow: 0 18px 48px rgba(0,0,0,.22); animation: toastIn .2s ease; border-right: 4px solid var(--brand);
}
.toast.error { border-color: #e45f5f; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; }
.modal.open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,18,15,.72); backdrop-filter: blur(6px); }
.modal-dialog {
    position: relative; width: min(470px, 100%); padding: 31px; border-radius: 23px; background: #fff; text-align: center; box-shadow: 0 30px 90px rgba(0,0,0,.25);
}
.success-icon { width: 62px; height: 62px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-size: 31px; font-weight: 800; }
.modal-dialog h2 { margin: 0 0 8px; }
.modal-dialog p { color: var(--muted); }
.reference-code { direction: ltr; font-weight: 800; letter-spacing: .07em; padding: 15px; margin: 17px 0; border-radius: 12px; background: #f2f5ed; border: 1px dashed var(--line-strong); overflow-wrap: anywhere; }
.modal-actions { display: flex; gap: 9px; justify-content: center; }

@media (max-width: 1050px) {
    :root { --sidebar: 270px; }
    .hero-card { grid-template-columns: minmax(0,1fr) repeat(3, 85px); }
}
@media (max-width: 860px) {
    .topbar { padding: 0 16px; height: 68px; }
    .brand-subtitle { display: none; }
    .layout { display: block; }
    .sidebar {
        position: static; height: auto; overflow: visible; padding: 16px; border-left: 0;
    }
    .sidebar-head, .privacy-note { display: none; }
    .progress-box { margin: 0 0 12px; }
    .step-nav { display: flex; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
    .step-link { flex: 0 0 auto; width: auto; white-space: nowrap; }
    .content { padding-top: 24px; }
}
@media (max-width: 680px) {
    .top-actions .danger-text { display: none; }
    .content { padding: 20px 13px 45px; }
    .hero-card { grid-template-columns: repeat(3, 1fr); padding: 19px; }
    .hero-card > div:first-child { grid-column: 1 / -1; }
    .hero-stat { min-height: 82px; }
    .form-grid.two, .review-grid { grid-template-columns: 1fr; }
    .requirement-card, .question-card { grid-template-columns: 36px minmax(0,1fr); padding: 15px; gap: 10px; }
    .req-number, .question-number, .doc-index { width: 34px; height: 34px; }
    .form-actions { border-radius: 13px; padding: 10px; }
    .btn { padding-inline: 13px; }
    .review-row { display: grid; gap: 4px; }
    .review-row strong { text-align: right; }
}
