/* مركز المهندس — customer website. Mobile first, RTL.
   Visual identity from the center's logo: orange + deep navy on white, orange/white zigzag,
   dark-grey icon tiles, heavy Arabic display type (Lalezar). */
:root {
  --primary: #f38c2f;        /* logo orange */
  --primary-dark: #d97316;
  --primary-soft: #fff1e3;
  --navy: #2f2541;           /* logo numbers / outlines */
  --navy-dark: #221a30;
  --navy-soft: #ece9f2;
  --tile: #343434;           /* logo icon boxes */
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --text: #2f2541;
  --muted: #6e6879;
  --line: #ece6df;
  --bg: #fffaf5;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(47, 37, 65, .06), 0 6px 18px rgba(47, 37, 65, .07);
  --display: "Lalezar", "Cairo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
[x-cloak] { display: none !important; }

.container { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* ---------- zigzag band (the logo's top & bottom pattern) ---------- */
.zigzag {
  height: 16px;
  background:
    linear-gradient(135deg, var(--primary) 33%, transparent 33%) 0 0 / 22px 16px repeat-x,
    linear-gradient(225deg, var(--primary) 33%, transparent 33%) 0 0 / 22px 16px repeat-x;
  background-color: #fff;
}
.zigzag-flip { transform: scaleY(-1); }

/* ---------- header / footer ---------- */
.site-header {
  background: var(--card);
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 10px rgba(47, 37, 65, .06);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; border: 2px solid var(--primary); }
.brand-text {
  font-family: var(--display);
  font-size: 1.55rem; line-height: 1;
  color: var(--primary);
  -webkit-text-stroke: 1px var(--navy);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--navy);
}
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: 9px; color: var(--navy); font-weight: 700; font-size: .95rem; }
.nav a:hover, .nav a.active { background: var(--navy-soft); color: var(--navy); text-decoration: none; }
.nav .nav-cta { background: var(--primary); color: #fff; }
.nav .nav-cta:hover { background: var(--primary-dark); color: #fff; }

.site-footer { margin-top: 48px; background: var(--navy); color: #d9d4e3; font-size: .9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 20px; padding-bottom: 28px; }
.site-footer a { color: #fff; font-weight: 600; }

main { padding: 24px 0; }

/* ---------- typography ---------- */
h1, h2, h3 { line-height: 1.4; margin: 0 0 12px; color: var(--navy); }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .2px; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .95rem; color: var(--navy); }
.input, select.input, textarea.input {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid #ddd4ca;
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: 3px solid var(--primary-soft); border-color: var(--primary); }
.input[dir="ltr"] { text-align: right; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
/* Honeypot: invisible without pushing the page sideways (a far negative offset widens RTL pages) */
.hp { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 800; cursor: pointer;
  background: var(--primary); color: #fff;
  box-shadow: 0 3px 0 var(--primary-dark);
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-navy { background: var(--navy); box-shadow: 0 3px 0 var(--navy-dark); }
.btn-navy:hover { background: var(--navy-dark); }
.btn-light { background: #fff; color: var(--navy); border-color: #ddd4ca; box-shadow: none; }
.btn-light:hover { background: var(--navy-soft); color: var(--navy); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f3c4c4; box-shadow: none; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-accent { background: var(--primary); color: #fff; }
.btn-accent:hover { background: var(--primary-dark); color: #fff; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.actions .btn { flex: 1 1 140px; }

/* ---------- alerts / badges ---------- */
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-info { background: var(--navy-soft); color: var(--navy); }
.alert-warn { background: var(--primary-soft); color: #9a4a06; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--navy-soft); color: var(--navy); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-muted { background: #f0eeee; color: var(--muted); }
.badge-warn { background: var(--primary-soft); color: #9a4a06; }

/* ---------- home ---------- */
.hero {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  position: relative;
}
.hero::before, .hero::after {
  content: ""; display: block; height: 16px;
  background:
    linear-gradient(135deg, var(--primary) 33%, transparent 33%) 0 0 / 22px 16px repeat-x,
    linear-gradient(225deg, var(--primary) 33%, transparent 33%) 0 0 / 22px 16px repeat-x;
}
.hero::after { transform: scaleY(-1); }
.hero-body { padding: 26px 22px 24px; position: relative; }
.hero-body::before {
  /* the orange disc of the logo */
  content: ""; position: absolute; left: -70px; bottom: -70px; width: 220px; height: 220px;
  border-radius: 50%; background: var(--primary); border: 6px solid var(--navy); opacity: .95; z-index: 0;
}
.hero-body > * { position: relative; z-index: 1; }
.hero-brand {
  font-family: var(--display);
  font-size: 2.6rem; line-height: 1.1;
  color: var(--primary);
  -webkit-text-stroke: 2px var(--navy);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--navy);
  margin-bottom: 6px;
}
.hero h1 { font-size: 1.35rem; color: var(--navy); max-width: 520px; }
.hero p { color: var(--muted); margin: 0 0 18px; max-width: 480px; font-weight: 600; }
.hero .actions { max-width: 440px; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 600px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }

.step-item { display: flex; gap: 12px; align-items: flex-start; }
.step-num { flex: 0 0 36px; height: 36px; border-radius: 10px; background: var(--tile); color: #fff; display: grid; place-items: center; font-weight: 800; }

/* contact card: dark-grey icon tiles + navy numbers, like the logo */
.contact-list { display: grid; gap: 10px; }
.contact-row { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.contact-row:hover { text-decoration: none; }
.contact-icon { flex: 0 0 44px; height: 44px; border-radius: 10px; background: var(--tile); display: grid; place-items: center; font-size: 1.2rem; }
.contact-num { font-family: "Cairo", sans-serif; font-weight: 800; font-size: 1.35rem; letter-spacing: .5px; color: var(--navy); }
.contact-addr { font-weight: 700; color: var(--primary-dark); }

/* ---------- selectable tiles ---------- */
.tile {
  border: 2px solid var(--line); border-radius: 12px; padding: 14px; background: #fff;
  cursor: pointer; text-align: center; font-weight: 800; color: var(--navy);
  transition: border-color .15s, background .15s; user-select: none;
}
.tile:hover { border-color: #f6c08f; }
.tile.selected { border-color: var(--primary); background: var(--primary-soft); color: var(--navy); }
.tile.disabled { opacity: .4; cursor: not-allowed; background: #f5f3f1; }
.tile .tile-icon { display: block; margin: 0 auto 6px; width: 64px; height: 64px; }
.tile .tile-icon svg { width: 100%; height: 100%; display: block; }
.device-tile { padding: 16px 10px; }
.tile .tile-sub { display: block; font-weight: 600; font-size: .8rem; color: var(--muted); }

.service-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.service-row.selected { border-color: var(--primary); background: var(--primary-soft); }
.service-row .price { font-weight: 800; color: var(--primary-dark); white-space: nowrap; }

/* ---------- wizard ---------- */
.progress { display: flex; gap: 6px; margin-bottom: 18px; }
.progress span { flex: 1; height: 7px; border-radius: 99px; background: var(--line); }
.progress span.done { background: var(--primary); }
.step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }

.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.day { padding: 10px 6px; }
.day .d-name { display: block; font-size: .85rem; }
.day .d-date { display: block; font-size: 1.05rem; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #f5f3f1; border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo button { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; line-height: 1; }
.photo-add { display: grid; place-items: center; border: 2px dashed #f2b47a; color: var(--primary-dark); cursor: pointer; font-weight: 800; text-align: center; font-size: .85rem; background: var(--primary-soft); }

.summary dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 700; }

/* ---------- orders ---------- */
.order-card { display: block; color: inherit; border-right: 4px solid var(--primary); }
.order-card:hover { text-decoration: none; border-color: var(--primary); }
.order-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.order-num { font-weight: 800; direction: ltr; color: var(--navy); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: .9rem; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 24px 16px 0; }
.timeline li::before { content: ""; position: absolute; right: 4px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 3px solid var(--navy); box-sizing: border-box; }
.timeline li::after { content: ""; position: absolute; right: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .t-label { font-weight: 800; }

.cost-table { width: 100%; border-collapse: collapse; }
.cost-table td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.cost-table td:last-child { text-align: left; font-weight: 700; }
.cost-table tr.total td { border: 0; font-size: 1.1rem; color: var(--primary-dark); }

.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty .big { font-size: 2.4rem; }

.spinner { width: 24px; height: 24px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .nav a { padding: 6px 8px; font-size: .88rem; }
  .brand-text { font-size: 1.25rem; }
  .brand-logo { width: 36px; height: 36px; }
  h1 { font-size: 1.5rem; }
  .hero-brand { font-size: 2.1rem; }
  .hero h1 { font-size: 1.15rem; }
  .hero-body::before { display: none; } /* would sit behind the buttons on narrow screens */
  .card { padding: 16px; }
  .contact-num { font-size: 1.15rem; }
}
