:root {
    --primary-900: #0f172a;
    --primary-800: #1e293b;
    --accent: #4f46e5;
    --cyan: #06b6d4;
    --indigo: #6366f1;
    --surface: #f8fafc;
    --line: #cbd5e1;
    --text: #0f172a;
    --text-soft: #475569;
    --radius: 16px;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'IBM Plex Sans', sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #ffffff 0%, #f4f7ff 100%);
    line-height: 1.7;
}

html[lang='ar'] body {
    font-family: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
}

.section {
    padding: 80px 0;
}

.section.soft {
    background: #f3f6fd;
}

.section-head {
    margin-bottom: 32px;
}

.eyebrow {
    display: inline-block;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 13px;
    color: var(--accent);
    text-transform: uppercase;
    margin: 0 0 12px;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 14px;
    line-height: 1.25;
}

p {
    margin: 0;
    color: var(--text-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 10px 18px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(120deg, var(--cyan), var(--indigo));
    color: #fff;
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(79, 70, 229, 0.3);
}

.btn-ghost {
    border-color: var(--line);
    color: var(--primary-800);
    background: #fff;
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(203, 213, 225, 0.7);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 84px;
}

.brand {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.brand img {
    width: 165px;
    max-width: 100%;
    height: auto;
    display: block;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.main-nav a {
    color: var(--text-soft);
    font-weight: 600;
    font-size: 14px;
    padding: 8px 4px;
    border-bottom: 2px solid transparent;
}

.main-nav a.active,
.main-nav a:hover {
    color: var(--text);
    border-color: var(--accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle {
    display: none;
    background: none;
    border: 0;
    padding: 8px;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--primary-800);
    display: block;
}

.hero-section {
    position: relative;
    overflow: hidden;
    padding: 96px 0 80px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-900), var(--primary-800));
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(6, 182, 212, 0.3), transparent 30%),
        radial-gradient(circle at 80% 10%, rgba(99, 102, 241, 0.4), transparent 35%),
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: auto, auto, 28px 28px, 28px 28px;
    animation: floatGrid 13s linear infinite;
}

@keyframes floatGrid {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 0 0, 0 28px, 28px 0; }
}

.hero-content {
    position: relative;
}

.hero-content h1 {
    max-width: 820px;
    font-size: clamp(32px, 5.2vw, 56px);
}

.hero-sub {
    margin-top: 18px;
    max-width: 760px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 18px;
}

.hero-actions {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-stats {
    margin-top: 42px;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-stats article {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    padding: 20px;
}

.hero-stats strong {
    font-size: 34px;
    display: block;
    margin-bottom: 6px;
}

.hero-stats span {
    color: rgba(255, 255, 255, 0.86);
}

.cards-grid {
    display: grid;
    gap: 18px;
}

.cards-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cards-grid.five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card,
.project-card,
.service-detail,
.portfolio-card,
.case-block,
.timeline-box,
.trust-box,
.security-note {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.card p,
.project-card p,
.service-detail p,
.portfolio-card p,
.case-block p {
    margin-bottom: 10px;
}

.project-card a,
.portfolio-card a {
    color: var(--accent);
    font-weight: 700;
}

.split {
    display: grid;
    gap: 24px;
    grid-template-columns: 1.15fr 1fr;
    align-items: start;
}

.feature-list {
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    position: relative;
    padding-inline-start: 24px;
    margin-bottom: 10px;
}

.feature-list li::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(120deg, var(--cyan), var(--accent));
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.timeline li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-weight: 600;
}

.timeline span {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e0e7ff;
    color: #312e81;
    font-size: 13px;
    font-weight: 700;
}

.tech-wall {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-wall span {
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600;
}

.estimator-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: calc(var(--radius) + 4px);
    padding: 26px;
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary-800);
    display: grid;
    gap: 8px;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    width: 100%;
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(79, 70, 229, 0.2);
    border-color: var(--accent);
}

.estimate-result {
    margin: 20px 0;
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(120deg, #ecfeff, #eef2ff);
    border: 1px solid #bfdbfe;
}

.estimate-result strong {
    display: block;
    font-size: 30px;
    color: #312e81;
    margin: 6px 0;
}

.estimate-result small {
    color: #334155;
}

.page-hero {
    padding: 72px 0 46px;
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
}

.page-hero h1 {
    font-size: clamp(30px, 4.6vw, 48px);
}

.service-detail-grid {
    display: grid;
    gap: 18px;
}

.service-detail ul,
.security-note ul,
.contact-info ul,
.case-block ul {
    margin: 0;
    padding-inline-start: 20px;
}

.profile-sheet {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-pitch {
    grid-column: span 2;
}

.faq-list {
    display: grid;
    gap: 12px;
}

.faq-list details {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 16px 18px;
}

.faq-list summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--primary-900);
}

.faq-list p {
    margin-top: 10px;
}

.error-wrap {
    text-align: center;
    max-width: 720px;
}

.error-wrap .hero-actions {
    justify-content: center;
}

.portfolio-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters {
    display: inline-flex;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}

.filters button {
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    background: transparent;
    cursor: pointer;
    color: var(--text-soft);
    font-weight: 700;
}

.filters button.active {
    background: var(--accent);
    color: #fff;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.badge {
    display: inline-flex;
    background: #ede9fe;
    color: #4c1d95;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}

.portfolio-card small {
    display: block;
    margin-bottom: 12px;
}

.case-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-layout {
    display: grid;
    gap: 22px;
    grid-template-columns: 1.15fr 1fr;
}

.contact-form,
.contact-info {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.contact-form {
    display: grid;
    gap: 12px;
}

.contact-quick-actions {
    margin: 12px 0 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.map-frame iframe {
    width: 100%;
    min-height: 240px;
    border: 0;
    border-radius: 12px;
}

.preview-switcher {
    display: inline-flex;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 20px;
}

.preview-switcher button {
    border: 0;
    background: transparent;
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-soft);
}

.preview-switcher button.active {
    background: var(--accent);
    color: #fff;
}

.preview-stage {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 16px;
}

.preview-stage.hidden {
    display: none;
}

.video-wrapper {
    border-radius: 12px;
    overflow: hidden;
    margin-top: 12px;
}

.video-wrapper video {
    display: block;
    width: 100%;
    max-height: 460px;
    object-fit: cover;
}

.readonly-shell {
    position: relative;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 12px;
}

.readonly-label {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    z-index: 3;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

.preview-expand-btn {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    z-index: 3;
    border: 0;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.preview-expand-btn:hover {
    background: #0f172a;
}

.readonly-shell iframe {
    width: 100%;
    min-height: 420px;
    border: 0;
}

.readonly-shell.expanded,
.readonly-shell:fullscreen,
.readonly-shell:-webkit-full-screen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    margin-top: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

.readonly-shell.expanded iframe,
.readonly-shell:fullscreen iframe,
.readonly-shell:-webkit-full-screen iframe {
    min-height: 100vh;
}

body.preview-lock {
    overflow: hidden;
}

.iframe-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.12));
    pointer-events: auto;
}

.cta-band {
    background: linear-gradient(120deg, var(--primary-900), #0b1120);
    color: #fff;
}

.cta-content {
    text-align: center;
}

.cta-content h2 {
    color: #fff;
    margin-bottom: 18px;
}

.site-footer {
    background: #0b1221;
    color: #cbd5e1;
    padding: 54px 0 18px;
}

.site-footer p,
.site-footer li,
.site-footer small {
    color: #cbd5e1;
}

.site-footer h3,
.site-footer h4 {
    color: #fff;
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.footer-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1.5fr 1fr 1fr;
}

.footer-bottom {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.floating-wa,
.floating-call {
    position: fixed;
    inset-inline-end: 18px;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 700;
    z-index: 40;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.2);
}

.floating-wa {
    bottom: 84px;
    background: #16a34a;
    color: #fff;
}

.floating-call {
    bottom: 34px;
    background: #0ea5e9;
    color: #fff;
}

.status-toast {
    position: fixed;
    top: 88px;
    inset-inline-start: 20px;
    z-index: 50;
    border-radius: 10px;
    padding: 11px 14px;
    color: #fff;
    font-weight: 700;
}

.status-success {
    background: #16a34a;
}

.status-error {
    background: #dc2626;
}

.admin-shell {
    width: min(1100px, calc(100% - 40px));
    margin: 34px auto 70px;
}

.admin-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.admin-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 14px;
}

.admin-kpis {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.kpi-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
}

.kpi-card span {
    font-size: 12px;
    color: #64748b;
    display: block;
}

.kpi-card strong {
    font-size: 24px;
    color: #0f172a;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 8px;
    text-align: start;
    vertical-align: top;
}

.admin-table th {
    color: #334155;
    font-weight: 700;
    background: #f8fafc;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.status-new {
    background: #e0f2fe;
    color: #0c4a6e;
}

.status-in_progress {
    background: #fef3c7;
    color: #92400e;
}

.status-closed {
    background: #dcfce7;
    color: #166534;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-expired {
    background: #fee2e2;
    color: #991b1b;
}

.admin-inline-form {
    display: grid;
    gap: 8px;
}

.admin-inline-form label {
    font-size: 12px;
}

.admin-inline-form textarea {
    min-height: 52px;
}

.kanban-board {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}

.kanban-column {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    min-height: 520px;
    display: grid;
    grid-template-rows: auto 1fr;
}

.kanban-column header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.kanban-column header h2 {
    font-size: 16px;
    margin: 0;
}

.kanban-column header span {
    background: #e2e8f0;
    color: #334155;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

.kanban-dropzone {
    padding: 12px;
    display: grid;
    gap: 10px;
    align-content: start;
    min-height: 440px;
    transition: background 0.2s ease;
}

.kanban-dropzone.active-drop {
    background: #ecfeff;
}

.kanban-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    cursor: grab;
}

.kanban-card.dragging {
    opacity: 0.6;
    transform: rotate(1deg);
    cursor: grabbing;
}

.kanban-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.kanban-card p,
.kanban-card small {
    display: block;
    margin: 0 0 4px;
    color: #475569;
    font-size: 12px;
    line-height: 1.45;
}

.kanban-card small.note {
    border-inline-start: 3px solid #cbd5e1;
    padding-inline-start: 8px;
}

.kanban-card-actions {
    margin-top: 8px;
}

.kanban-hint {
    margin-top: 12px;
    font-size: 13px;
}

.kanban-toast {
    position: fixed;
    inset-inline-end: 16px;
    bottom: 20px;
    z-index: 60;
    background: #16a34a;
    color: #fff;
    border-radius: 10px;
    padding: 10px 13px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.24);
}

.kanban-toast.error {
    background: #dc2626;
}

.admin-login {
    min-height: calc(100vh - 180px);
    display: grid;
    place-items: center;
    padding: 30px 0;
}

.admin-login .admin-card {
    width: min(460px, calc(100% - 20px));
}

.admin-login.stack {
    place-items: start center;
    min-height: auto;
}

.admin-login-stack {
    width: min(1100px, calc(100% - 20px));
    display: grid;
    gap: 16px;
}

.admin-login-stack .login-card {
    width: min(460px, 100%);
    justify-self: center;
}

@media (max-width: 1024px) {
    .cards-grid.three,
    .cards-grid.four,
    .cards-grid.five,
    .portfolio-grid,
    .case-grid,
    .contact-layout,
    .split,
    .profile-sheet,
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-pitch {
        grid-column: span 2;
    }

    .kanban-board {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .main-nav,
    .nav-actions .btn-primary {
        display: none;
    }

    .main-nav.open {
        position: absolute;
        top: 74px;
        inset-inline: 0;
        display: grid;
        background: #fff;
        padding: 12px 20px;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
    }

    .menu-toggle {
        display: flex;
    }

    .brand img {
        width: 120px;
    }

    .hero-stats,
    .cards-grid.three,
    .cards-grid.four,
    .cards-grid.five,
    .portfolio-grid,
    .case-grid,
    .contact-layout,
    .split,
    .profile-sheet,
    .footer-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .profile-pitch {
        grid-column: span 1;
    }

    .hero-section {
        padding-top: 82px;
    }

    .hero-sub {
        font-size: 16px;
    }

    .estimate-result strong {
        font-size: 24px;
    }

    .floating-wa,
    .floating-call {
        inset-inline-end: 12px;
    }

    .admin-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
