/* معمل الوثيقة السيادي — لوحة المعالجة + شهادة النتيجة */
:root {
  --sov-scan: #2ee6c8;
  --sov-valid: #e6c82e;
  --sov-auth: #e652a8;
  --sov-date: #12a06a;
  --sov-panel: rgba(8, 22, 18, 0.92);
  --sov-glow-scan: rgba(46, 230, 200, 0.45);
}

.sov-page {
  min-height: 100vh;
  padding: 1.25rem 1rem 3rem;
  position: relative;
  z-index: 1;
}

.sov-topbar {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sov-brand-mark {
  flex-shrink: 0;
  width: clamp(44px, 7vw, 56px);
  height: clamp(44px, 7vw, 56px);
  border-radius: 14px;
  background: linear-gradient(168deg, rgba(26, 51, 40, 0.96), rgba(6, 14, 11, 0.99));
  border: 1px solid rgba(196, 165, 116, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 18px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.sov-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.sov-topbar a {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.9rem;
}
.sov-topbar a:hover {
  text-decoration: underline;
}

.sov-title {
  font-family: "Cormorant Garamond", var(--font-display), serif;
  font-size: clamp(1.2rem, 3.2vw, 1.65rem);
  font-weight: 700;
  color: var(--text);
  flex: 1 1 200px;
  min-width: 0;
  line-height: 1.35;
}

.sov-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sov-btn {
  font-family: var(--font-body);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s, border-color 0.2s;
}
.sov-btn:hover {
  background: rgba(13, 122, 79, 0.35);
  border-color: var(--emerald-bright);
}
.sov-btn--primary {
  background: linear-gradient(135deg, rgba(13, 122, 79, 0.5), rgba(12, 28, 22, 0.9));
  border-color: var(--emerald-bright);
}

.sov-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .sov-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
}

/* —— لوحة المستند + المسح —— */
.sov-doc-panel {
  background: var(--sov-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-glow);
}

.sov-doc-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(145deg, #1a2820 0%, #0a1210 50%, #152018 100%);
  border: 1px solid rgba(212, 175, 55, 0.15);
}

.sov-doc-texture {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.sov-doc-fibers {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    92deg,
    transparent,
    transparent 2px,
    rgba(46, 230, 200, 0.03) 2px,
    rgba(46, 230, 200, 0.03) 3px
  );
  pointer-events: none;
}

.sov-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--sov-glow-scan),
    #fff,
    var(--sov-glow-scan),
    transparent
  );
  box-shadow: 0 0 24px var(--sov-scan), 0 0 48px rgba(46, 230, 200, 0.3);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

.sov-doc-frame.is-scanning .sov-laser {
  opacity: 1;
  animation: sov-laser-sweep 2.8s ease-in-out infinite;
}

@keyframes sov-laser-sweep {
  0% {
    top: 0;
    transform: scaleX(1);
  }
  50% {
    top: calc(100% - 6px);
    transform: scaleX(1.02);
  }
  100% {
    top: 0;
    transform: scaleX(1);
  }
}

.sov-det-box {
  position: absolute;
  border: 1px solid rgba(46, 230, 200, 0.7);
  background: rgba(46, 230, 200, 0.06);
  box-shadow: 0 0 12px rgba(46, 230, 200, 0.25);
  z-index: 3;
  animation: sov-box-pop 0.35s var(--ease-out) forwards;
  opacity: 0;
}

@keyframes sov-box-pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.sov-doc-caption {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* —— رادار + طرفية —— */
.sov-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sov-radar-wrap {
  background: var(--sov-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}

.sov-radar {
  width: min(220px, 70vw);
  height: min(220px, 70vw);
  margin: 0 auto 1rem;
  position: relative;
  isolation: isolate;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(8, 22, 18, 0.95) 0%, rgba(8, 22, 18, 0.98) 42%, transparent 43%),
    repeating-conic-gradient(from 0deg, rgba(46, 230, 200, 0.06) 0deg 8deg, transparent 8deg 16deg);
  border: 1px solid rgba(46, 230, 200, 0.25);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(13, 122, 79, 0.2);
}

.sov-radar::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, var(--sov-glow-scan) 28deg, transparent 56deg);
  animation: sov-radar-spin 3.2s linear infinite;
  opacity: 0.85;
}

.sov-radar.phase-scan::after {
  animation-duration: 2.4s;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(46, 230, 200, 0.5) 32deg, transparent 64deg);
}
.sov-radar.phase-valid::after {
  animation-duration: 2.8s;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(230, 200, 46, 0.55) 36deg, transparent 72deg);
}
.sov-radar.phase-auth::after {
  animation-duration: 2.2s;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(230, 82, 168, 0.5) 30deg, transparent 60deg);
}
.sov-radar.phase-date::after {
  animation-duration: 3.5s;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(18, 160, 106, 0.55) 34deg, transparent 68deg);
}

@keyframes sov-radar-spin {
  to {
    transform: rotate(360deg);
  }
}

.sov-radar-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--emerald-bright), #062018);
  box-shadow: 0 0 20px var(--emerald-bright);
  z-index: 2;
}

.sov-radar-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-height: 2.5em;
}

.sov-terminal {
  background: rgba(3, 8, 6, 0.95);
  border: 1px solid rgba(46, 230, 200, 0.2);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.72rem;
  line-height: 1.55;
  text-align: left;
  direction: ltr;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45);
}

.sov-terminal-line {
  margin-bottom: 0.35rem;
  opacity: 0;
  animation: sov-line-in 0.25s ease forwards;
}

@keyframes sov-line-in {
  to {
    opacity: 1;
  }
}

.sov-terminal-line--scan {
  color: var(--sov-scan);
}
.sov-terminal-line--valid {
  color: var(--sov-valid);
}
.sov-terminal-line--auth {
  color: var(--sov-auth);
}
.sov-terminal-line--date {
  color: var(--sov-date);
}
.sov-terminal-line--dim {
  color: rgba(232, 244, 239, 0.45);
}

/* —— مسار الفيديو السينمائي (معلومات) —— */
.sov-pipeline {
  max-width: 1100px;
  margin: 2rem auto 0;
  background: var(--sov-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.sov-pipeline h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--gold);
}

.sov-pipeline ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.sov-pipeline li {
  padding-inline-start: 1rem;
  position: relative;
}
.sov-pipeline li::before {
  content: "▸";
  position: absolute;
  inset-inline-start: 0;
  color: var(--emerald-bright);
  font-size: 0.7rem;
}

/* —— شهادة النتيجة (Result Shield) —— */
.sov-shield-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 4, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.sov-shield-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sov-shield {
  width: min(420px, 100%);
  position: relative;
  border-radius: 20px;
  padding: 2rem 1.75rem 1.75rem;
  background: linear-gradient(165deg, rgba(18, 42, 32, 0.98) 0%, rgba(8, 18, 14, 0.99) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(46, 230, 200, 0.08);
  transform: scale(0.94) translateY(12px);
  transition: transform 0.5s var(--ease-out);
}

.sov-shield-backdrop.is-open .sov-shield {
  transform: scale(1) translateY(0);
}

.sov-shield-wm {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.09;
  background: url("../brand/saad-logo.png") 50% 50% / min(120%, 380px) no-repeat;
  transform: rotate(-8deg);
  filter: saturate(0.85);
  user-select: none;
}

.sov-shield h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 1.25rem;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.sov-shield-score {
  text-align: center;
  font-size: clamp(2.2rem, 8vw, 3rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--emerald-bright), var(--sov-scan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.35rem;
  position: relative;
  z-index: 1;
}

.sov-shield-sub {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.sov-shield-hash {
  font-family: ui-monospace, monospace;
  font-size: 0.62rem;
  line-height: 1.5;
  word-break: break-all;
  color: rgba(232, 244, 239, 0.55);
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.12);
  position: relative;
  z-index: 1;
}

.sov-shield-meta {
  margin-top: 1rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  position: relative;
  z-index: 1;
}

.sov-shield-close {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(13, 122, 79, 0.25);
  color: var(--text);
  font-family: var(--font-body);
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.sov-shield-close:hover {
  background: rgba(13, 122, 79, 0.45);
}

.sov-shield-seal {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(212, 175, 55, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--gold);
  z-index: 2;
}
