/* ============================================================
   مكتب الشكاوي - جهاز الأمن الداخلي-المنطقة الشرقية
   النظام البصري الموحَّد
   ============================================================ */

:root {
    --bg:           #0a1729;
    --bg-deep:      #050d1c;
    --bg-card:      rgba(255,255,255,0.04);
    --bg-input:     rgba(0,0,0,0.32);
    --gold:         #c9a961;
    --gold-bright:  #e3c781;
    --gold-dark:    #a88a45;
    --cream:        #f4f1ea;
    --dim:          #8da3bd;
    --dim-2:        #5d7290;
    --border:       rgba(201,169,97,0.25);
    --border-strong:rgba(201,169,97,0.45);
    --danger:       #e57373;
    --success:      #7dd49b;
    --warn:         #ffc966;
    --crimson:      #8b1e1e;
    --radius:       14px;
    --shadow-card:  0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
    --shadow-elev:  0 12px 40px rgba(201,169,97,0.18);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', 'Tahoma', sans-serif;
    background: var(--bg);
    color: var(--cream);
    min-height: 100vh;
    line-height: 1.7;
    background-image:
        radial-gradient(circle at 15% 0%, rgba(20,40,69,0.7) 0, transparent 55%),
        radial-gradient(circle at 85% 100%, rgba(13,31,58,0.7) 0, transparent 55%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* نقش هندسي عربي خفيف في الخلفية */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><g fill='none' stroke='%23c9a961' stroke-width='0.5' opacity='0.06'><path d='M40 0 L80 40 L40 80 L0 40 Z'/><circle cx='40' cy='40' r='20'/><circle cx='40' cy='40' r='10'/></g></svg>");
    background-size: 80px 80px;
    pointer-events: none;
    z-index: -1;
}

a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-bright); }

/* ============================================================
   الترويسة الرسمية
   ============================================================ */
.topbar {
    background: linear-gradient(180deg, rgba(8,18,38,0.95) 0%, rgba(10,23,41,0.85) 100%);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.brand-row { display: flex; align-items: center; gap: 14px; }

.crest {
    width: 60px; height: 60px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: #1a1a1a;
    box-shadow: 0 0 18px rgba(201,169,97,0.15), inset 0 0 0 2px var(--gold);
    flex-shrink: 0;
}
.crest img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand-titles h1.brand-title {
    font-family: 'Amiri', serif;
    color: var(--gold);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}
.brand-titles .brand-sub {
    color: var(--dim);
    font-size: 13px;
    letter-spacing: 0.5px;
}

.nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nav a {
    color: var(--cream);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
}
.nav a:hover { background: rgba(201,169,97,0.1); color: var(--gold); }
.nav a.active { background: rgba(201,169,97,0.15); color: var(--gold); }

/* ============================================================
   البطل (Hero) للصفحة الرئيسية
   ============================================================ */
.hero {
    padding: 90px 24px 70px;
    text-align: center;
    position: relative;
}

.crest-big, .hero .crest-big {
    width: 140px; height: 140px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 22px;
    display: flex; align-items: center; justify-content: center;
    background: #1a1a1a;
    box-shadow: 0 0 50px rgba(201,169,97,0.25), inset 0 0 0 3px var(--gold);
}
.crest-big img, .hero .crest-big img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero h1 {
    font-family: 'Amiri', serif;
    color: var(--gold);
    font-size: clamp(28px, 4.5vw, 44px);
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 20px rgba(201,169,97,0.15);
}

.hero .subtitle {
    color: var(--dim);
    font-size: clamp(15px, 2vw, 18px);
    letter-spacing: 0.6px;
    margin-bottom: 30px;
}

.hero .lead {
    max-width: 720px;
    margin: 0 auto 36px;
    color: var(--cream);
    font-size: clamp(15px, 1.6vw, 17px);
    line-height: 1.9;
    opacity: 0.92;
}

.cta-row { display: inline-flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ============================================================
   الأزرار
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 30px;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
    color: var(--bg);
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 16px rgba(201,169,97,0.25);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-elev); color: var(--bg); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 1.5px solid var(--gold);
    box-shadow: none;
}
.btn-outline:hover { background: rgba(201,169,97,0.1); color: var(--gold); }

.btn-ghost {
    background: rgba(255,255,255,0.04);
    color: var(--cream);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn-ghost:hover { background: rgba(255,255,255,0.07); color: var(--gold-bright); }

.btn-danger { background: linear-gradient(180deg, #c54a4a, var(--crimson)); color: white; }

.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ============================================================
   الأقسام والبطاقات
   ============================================================ */
.section { padding: 60px 0; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

.section-title {
    text-align: center;
    font-family: 'Amiri', serif;
    color: var(--gold);
    font-size: clamp(24px, 3vw, 32px);
    margin-bottom: 14px;
}

.section-lead {
    text-align: center;
    color: var(--dim);
    font-size: 15px;
    max-width: 640px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
    transition: transform .25s, border-color .25s;
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.feature-card .icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(201,169,97,0.18), rgba(201,169,97,0.06));
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--gold);
    font-size: 24px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
}
.feature-card h3 { color: var(--gold); font-family: 'Amiri', serif; font-size: 20px; margin-bottom: 8px; }
.feature-card p  { color: var(--dim); font-size: 14px; line-height: 1.8; }

/* ============================================================
   النموذج (Form)
   ============================================================ */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
}

.form-card h2 {
    color: var(--gold);
    font-family: 'Amiri', serif;
    font-size: 22px;
    margin-bottom: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.form-card h2 .step-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--bg);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700;
    flex-shrink: 0;
}
.form-card .form-card-sub {
    color: var(--dim);
    font-size: 13px;
    margin-top: 4px;
    margin-bottom: 18px;
}

.form-group { margin-bottom: 16px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

label {
    display: block;
    color: var(--gold);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}
label .req { color: var(--danger); margin-right: 2px; }

input[type=text],
input[type=tel],
input[type=email],
input[type=url],
input[type=password],
input[type=number],
input[type=search],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--cream);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,169,97,0.12);
}
input::placeholder, textarea::placeholder { color: var(--dim-2); }

textarea { min-height: 140px; resize: vertical; line-height: 1.7; }

.field-hint {
    color: var(--dim);
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.6;
}

/* رفع الملفات بسحب وإفلات */
.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    background: rgba(0,0,0,0.15);
    transition: all .2s;
    cursor: pointer;
}
.dropzone:hover, .dropzone.dragover {
    background: rgba(201,169,97,0.08);
    border-color: var(--gold);
}
.dropzone .dz-text { color: var(--cream); font-size: 16px; margin-bottom: 6px; font-weight: 600; }
.dropzone .dz-sub  { color: var(--dim); font-size: 12px; }

.file-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.file-row {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex; align-items: center; gap: 12px;
}
.file-row .fname { flex: 1; color: var(--cream); font-size: 14px; word-break: break-all; }
.file-row .fsize { color: var(--dim); font-size: 12px; white-space: nowrap; }
.file-row .frm   { color: var(--danger); cursor: pointer; background: transparent; border: none; font-size: 18px; padding: 0 6px; }

/* ============================================================
   التنبيهات
   ============================================================ */
.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.7;
    border-right: 4px solid;
}
.alert.error   { background: rgba(229,115,115,0.10); color: #ffb4b4; border-color: var(--danger); }
.alert.success { background: rgba(125,212,155,0.10); color: #b8e9c9; border-color: var(--success); }
.alert.info    { background: rgba(201,169,97,0.10);  color: #e0cea0;  border-color: var(--gold); }
.alert.warn    { background: rgba(255,201,102,0.10); color: #ffe0a0; border-color: var(--warn); }
.alert strong { color: inherit; }

/* ============================================================
   صفحة النجاح
   ============================================================ */
.success-card {
    background: var(--bg-card);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 50px 30px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-elev);
}
.success-card .check-circle {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(76,175,80,0.35);
    position: relative;
}
.success-card .check-circle::before {
    content: '';
    width: 22px; height: 40px;
    border-right: 5px solid white;
    border-bottom: 5px solid white;
    transform: rotate(45deg) translateY(-3px);
}
.success-card h2 { color: var(--gold); font-family: 'Amiri', serif; font-size: 30px; margin-bottom: 12px; }
.success-card .ref-box {
    background: rgba(201,169,97,0.1);
    border: 1px dashed var(--gold);
    border-radius: 12px;
    padding: 18px 24px;
    margin: 26px auto 14px;
    display: inline-block;
}
.success-card .ref-box .ref-label { color: var(--dim); font-size: 13px; margin-bottom: 4px; }
.success-card .ref-box .ref-code {
    font-family: 'Consolas', 'Courier New', monospace;
    color: var(--gold-bright);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 2px;
    direction: ltr;
}
.copy-btn {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    margin-right: 10px;
    font-family: inherit;
}

/* ============================================================
   التذييل
   ============================================================ */
.footer {
    background: rgba(5,13,28,0.9);
    border-top: 1px solid var(--border);
    padding: 30px 24px;
    margin-top: 60px;
    text-align: center;
    color: var(--dim);
    font-size: 13px;
}

.footer .footer-brand { color: var(--gold); font-family: 'Amiri', serif; font-size: 16px; margin-bottom: 6px; }
.footer .footer-line { margin: 4px 0; }

/* ============================================================
   نطاقات صغيرة
   ============================================================ */
@media (max-width: 720px) {
    .topbar-inner { flex-direction: column; align-items: flex-start; }
    .hero { padding: 60px 16px 40px; }
    .section { padding: 40px 0; }
    .form-card { padding: 22px 18px; }
}

/* ============================================================
   شريط التقدم لإرسال النموذج
   ============================================================ */
.progress-overlay {
    position: fixed; inset: 0;
    background: rgba(5,13,28,0.85);
    display: none;
    align-items: center; justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}
.progress-overlay.active { display: flex; }
.progress-overlay .prog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 40px;
    text-align: center;
    max-width: 420px;
}
.progress-overlay .spinner {
    width: 50px; height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    margin: 0 auto 18px;
    animation: spin 0.9s linear infinite;
}
.progress-overlay h3 { color: var(--gold); font-family: 'Amiri', serif; margin-bottom: 8px; font-size: 20px; }
.progress-overlay p  { color: var(--dim); font-size: 14px; }

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