/* Enterprise CMMS — Critical Error / Service Unavailable
   Standalone, no external dependencies. RTL-first. */

@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg-0: #04080f;
  --bg-1: #070d1a;
  --bg-2: #0c1527;
  --navy: #0f1d36;
  --charcoal: #141a24;
  --line: rgba(148, 170, 205, 0.14);
  --line-strong: rgba(148, 170, 205, 0.24);
  --text: #eef2f8;
  --text-2: #b7c3d6;
  --text-3: #8392aa;
  --brand: #6f9bc2;
  --red: #ff3b42;
  --red-soft: #ff6b70;
  --red-deep: #b3121b;
  --red-glow: rgba(255, 46, 56, 0.35);
  --radius: 22px;
  --font: "Plex Arabic", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg-1);
  background-image:
    radial-gradient(1200px 700px at 50% -10%, #12234280 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, #1a12185c 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ───────── Background depth ───────── */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.backdrop__grid {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(rgba(148,170,205,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,170,205,.05) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 0%, transparent 78%);
          mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 0%, transparent 78%);
  opacity: .55;
}

.backdrop__glow {
  position: absolute; left: 50%; top: 46%;
  width: min(980px, 140vw); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 40, 52, .16) 0%, rgba(255, 40, 52, .05) 32%, transparent 62%);
  animation: glow 5.5s ease-in-out infinite;
}

.backdrop__mark {
  position: absolute;
  inset-inline-start: -6vw; bottom: -14vh;
  height: min(92vh, 860px); width: auto;
  opacity: .045;
  filter: grayscale(1) brightness(2.2);
}

.backdrop__scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
}

body::after { /* vignette */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
}

.topbar, .stage, .footer { position: relative; z-index: 1; }

/* ───────── Top bar ───────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(16px, 2.4vw, 28px) clamp(16px, 4.5vw, 64px);
}

.brand { display: flex; align-items: center; gap: 18px; min-width: 0; }

.brand__plate {
  flex: none;
  display: grid; place-items: center;
  width: 118px; height: 118px;
  padding: 11px;
  border-radius: 24px;
  background: linear-gradient(160deg, #ffffff 0%, #eaf0f7 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.6) inset,
    0 0 0 1px rgba(10, 20, 40, .6),
    0 18px 40px -12px rgba(0, 0, 0, .7),
    0 0 0 6px rgba(111, 155, 194, .08);
}
.brand__logo { display: block; width: 100%; height: auto; }

.brand__meta { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.brand__product { font-weight: 600; font-size: 1.12rem; color: var(--text); }
.brand__sub {
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand); font-weight: 600; text-align: right;
}

.status-chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 18px;
  border-radius: 999px;
  font-size: .9rem; font-weight: 600;
  color: #ffd9da;
  background: linear-gradient(180deg, rgba(255, 59, 66, .16), rgba(255, 59, 66, .08));
  border: 1px solid rgba(255, 90, 95, .38);
  box-shadow: 0 0 24px -6px var(--red-glow), inset 0 1px 0 rgba(255,255,255,.06);
}
.status-chip__dot {
  position: relative; width: 9px; height: 9px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 10px var(--red);
}
.status-chip__dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1.5px solid var(--red); opacity: 0;
  animation: ping 2.4s cubic-bezier(.2,.6,.3,1) infinite;
}

/* ───────── Stage / panel ───────── */
.stage {
  flex: 1;
  display: grid; place-items: center;
  padding: 0 clamp(16px, 4vw, 48px) clamp(28px, 3.5vw, 40px);
}

.panel {
  position: relative;
  width: min(100%, 720px);
  padding: clamp(34px, 4.4vw, 50px) clamp(22px, 5.5vw, 64px) clamp(30px, 3.8vw, 42px);
  text-align: center;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(22, 33, 56, .78) 0%, rgba(12, 19, 33, .86) 100%);
  border: 1px solid var(--line-strong);
  box-shadow:
    0 1px 0 rgba(255,255,255,.06) inset,
    0 40px 80px -30px rgba(0, 0, 0, .85),
    0 0 0 1px rgba(0,0,0,.4),
    0 0 120px -40px var(--red-glow);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
          backdrop-filter: blur(14px) saturate(120%);
  animation: rise .9s cubic-bezier(.2,.7,.2,1) both;
}

.panel__edge { /* red accent rule along the top edge */
  position: absolute; top: -1px; left: 12%; right: 12%; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--red) 25%, var(--red-soft) 50%, var(--red) 75%, transparent);
  box-shadow: 0 0 18px 1px var(--red-glow);
}
.panel::before, .panel::after { /* corner brackets */
  content: ""; position: absolute; width: 22px; height: 22px;
  border-color: rgba(255, 107, 112, .55); border-style: solid; pointer-events: none;
}
.panel::before { bottom: 14px; right: 14px; border-width: 0 2px 2px 0; border-bottom-right-radius: 8px; }
.panel::after  { bottom: 14px; left: 14px;  border-width: 0 0 2px 2px; border-bottom-left-radius: 8px; }

/* Icon */
.alert-icon {
  position: relative;
  width: clamp(100px, 14vw, 120px); aspect-ratio: 1;
  margin: 0 auto clamp(20px, 2.6vw, 26px);
  display: grid; place-items: center;
}
.alert-icon::before { /* halo plate */
  content: ""; position: absolute; inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 50, 60, .28) 0%, rgba(255, 50, 60, .06) 55%, transparent 70%);
  animation: glow 2.8s ease-in-out infinite;
}
.alert-icon__ring {
  position: absolute; inset: -6%;
  border-radius: 50%;
  border: 1px solid rgba(255, 90, 95, .45);
  animation: ring 2.8s cubic-bezier(.2,.6,.3,1) infinite;
}
.alert-icon__ring--2 { animation-delay: 1.4s; }
.alert-icon__glyph {
  position: relative; width: 100%; height: 100%;
  filter: drop-shadow(0 10px 22px rgba(255, 30, 40, .45)) drop-shadow(0 2px 2px rgba(0,0,0,.4));
  animation: pulse 2.8s ease-in-out infinite;
}

.panel__code {
  display: inline-flex; align-items: center; gap: 12px;
  margin: 0 0 14px;
  padding: 5px 14px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: .74rem; letter-spacing: .16em; font-weight: 600;
  color: var(--red-soft);
  background: rgba(255, 59, 66, .07);
  border: 1px solid rgba(255, 90, 95, .22);
  direction: ltr;
}
.panel__code .sep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .6; }

.panel__title {
  margin: 0;
  font-weight: 700;
  font-size: clamp(2.15rem, 6.2vw, 3.6rem);
  line-height: 1.25;
  letter-spacing: 0;
  background: linear-gradient(180deg, #ffffff 0%, #ffdfe0 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: none;
}

.panel__subtitle {
  margin: 10px 0 0;
  font-weight: 600;
  font-size: clamp(1.15rem, 2.8vw, 1.5rem);
  color: var(--red-soft);
}

.panel__rule {
  width: 120px; height: 1px; margin: clamp(20px, 2.6vw, 26px) auto;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  position: relative;
}
.panel__rule::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 7px; height: 7px; transform: translate(-50%, -50%) rotate(45deg);
  background: var(--bg-2); border: 1px solid rgba(255, 107, 112, .7);
}

.panel__text {
  margin: 0 auto;
  max-width: 34em;
  font-size: clamp(1rem, 2.1vw, 1.12rem);
  line-height: 2;
  color: var(--text-2);
}

/* Service list */
.services {
  margin: clamp(24px, 3.2vw, 32px) 0 0;
  padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  border-radius: 14px; overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
}
.services__row {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 12px;
  background: rgba(8, 14, 26, .72);
}
.services dt { font-size: .92rem; font-weight: 500; color: var(--text); }
.services dd { margin: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .78rem; font-weight: 600; color: #ffc2c4;
}
.pill::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px;
  background: var(--red); box-shadow: 0 0 8px var(--red-glow);
}
.pill--ok { color: #a6f0c8; }
.pill--ok::before {
  width: 13px; height: 13px; border-radius: 50%;
  background: #22c27a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 6.3l2.2 2.2 4.6-4.8' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
  box-shadow: 0 0 8px rgba(34, 194, 122, .45);
}

/* Footer */
.footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px;
  padding: 0 16px clamp(20px, 3vw, 30px);
  font-size: .8rem; color: var(--text-3);
}
.footer__sep { width: 1px; height: 12px; background: var(--line-strong); }

/* ───────── Motion ───────── */
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes glow  { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes ring  { 0% { transform: scale(.92); opacity: .7; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes ping  { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes rise  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .alert-icon__ring { display: none; }
}

/* ───────── Responsive ───────── */
@media (max-width: 760px) {
  .services { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 16px; }
  .brand { justify-content: center; }
  .brand__plate { width: 92px; height: 92px; padding: 9px; border-radius: 20px; }
  .status-chip { align-self: center; }
}

@media (max-width: 520px) {
  .services { grid-template-columns: 1fr; }
  .services__row { flex-direction: row; justify-content: space-between; padding: 13px 18px; }
  .panel::before, .panel::after { display: none; }
  .panel__code { font-size: .66rem; letter-spacing: .12em; }
}

@media (max-height: 640px) and (min-width: 721px) {
  .topbar { padding-block: 14px; }
  .brand__plate { width: 84px; height: 84px; }
}

@media (forced-colors: active) {
  .panel__title { color: CanvasText; background: none; }
  .panel, .status-chip { border: 1px solid CanvasText; }
}

@media print {
  .backdrop, body::after { display: none; }
  body { background: #fff; color: #000; }
}
