:root {
  --bg: #06111f;
  --panel: rgba(12, 25, 43, 0.92);
  --panel-strong: #0d1b2d;
  --line: rgba(148, 163, 184, 0.22);
  --text: #f7fbff;
  --muted: #a8bdd5;
  --blue: #2387ff;
  --cyan: #22d3ee;
  --green: #22c55e;
  --mint: #8bffcf;
  --gold: #facc15;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Cairo", "Inter", system-ui, sans-serif;
  background:
    linear-gradient(135deg, rgba(35, 135, 255, 0.18) 0%, transparent 36%),
    linear-gradient(225deg, rgba(34, 197, 94, 0.14) 0%, transparent 34%),
    linear-gradient(180deg, #06111f 0%, #091827 56%, #06111f 100%);
}

body[dir="ltr"] {
  font-family: "Inter", "Cairo", system-ui, sans-serif;
}

button,
a {
  font: inherit;
}

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

.completion-shell {
  position: relative;
  width: min(1180px, 100%);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  margin: 0 auto;
  padding: 24px;
}

.completion-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: var(--radius);
  background: rgba(10, 22, 38, 0.72);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

.brand span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #dff7ff;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(35, 135, 255, 0.28), rgba(34, 197, 94, 0.18));
}

.brand b {
  font-size: 1rem;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.updated-pill,
.lang-button,
.success-pill,
.official-link-card,
.proof-grid article,
.toast {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 25, 43, 0.82);
}

.updated-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.lang-button {
  min-width: 48px;
  min-height: 42px;
  color: var(--text);
  cursor: pointer;
}

.completion-card {
  position: relative;
  z-index: 1;
  align-self: center;
  overflow: hidden;
  display: grid;
  justify-items: center;
  gap: 22px;
  padding: 44px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(35, 135, 255, 0.16), rgba(34, 197, 94, 0.1) 48%, rgba(250, 204, 21, 0.08)),
    var(--panel);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
  text-align: center;
}

.completion-card::before,
.completion-card::after {
  content: "";
  position: absolute;
  inset: auto 8% 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 255, 207, 0.86), transparent);
}

.completion-card::after {
  inset: 0 12% auto;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.72), transparent);
}

.seal {
  position: relative;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 255, 207, 0.22), rgba(35, 135, 255, 0.12) 58%, rgba(12, 25, 43, 0.72));
}

.seal-ring {
  position: absolute;
  inset: 9px;
  border: 2px solid rgba(139, 255, 207, 0.64);
  border-left-color: rgba(34, 211, 238, 0.28);
  border-radius: 50%;
  animation: sealSpin 8s linear infinite;
}

.seal svg {
  width: 50px;
  height: 50px;
  color: var(--mint);
  filter: drop-shadow(0 0 20px rgba(34, 197, 94, 0.32));
}

.success-pill {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.13);
  border-color: rgba(34, 197, 94, 0.32);
}

.success-pill svg {
  width: 21px;
  height: 21px;
}

h1,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: 4rem;
  line-height: 1.15;
  font-weight: 800;
}

.completion-card > p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.9;
}

.official-link-card {
  width: min(760px, 100%);
  display: grid;
  gap: 8px;
  padding: 16px;
  background: rgba(7, 17, 31, 0.52);
}

.official-link-card span {
  color: #9edcff;
  font-weight: 700;
}

.official-link-card a {
  direction: ltr;
  unicode-bidi: embed;
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 800;
}

.completion-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.primary-action,
.secondary-action {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.primary-action {
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: white;
  background: linear-gradient(135deg, #2387ff, #22d3ee 48%, #22c55e);
  box-shadow: 0 18px 38px rgba(34, 211, 238, 0.18);
}

.secondary-action {
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--text);
  background: rgba(15, 23, 42, 0.78);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 255, 207, 0.7);
}

.primary-action svg,
.secondary-action svg {
  width: 21px;
  height: 21px;
}

.proof-grid {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.proof-grid article {
  min-height: 132px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 16px;
  background: rgba(9, 24, 41, 0.72);
}

.proof-grid svg {
  width: 34px;
  height: 34px;
  color: var(--cyan);
}

.proof-grid article:nth-child(2) svg {
  color: var(--gold);
}

.proof-grid article:nth-child(3) svg {
  color: var(--mint);
}

.proof-grid strong {
  font-size: 1rem;
}

.proof-grid span {
  color: var(--muted);
  line-height: 1.6;
}

.completion-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  color: #dcfce7;
  background: rgba(20, 83, 45, 0.94);
  border-color: rgba(134, 239, 172, 0.38);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast svg {
  width: 20px;
  height: 20px;
}

.confetti-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-field span {
  position: absolute;
  top: -28px;
  left: var(--x);
  width: 8px;
  height: 18px;
  border-radius: 2px;
  background: var(--c);
  opacity: 0.72;
  animation: confettiFall 6.8s linear infinite;
  animation-delay: var(--d);
}

.confetti-field span:nth-child(3n) {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.confetti-field span:nth-child(4n) {
  width: 16px;
  height: 6px;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-40px) rotate(0deg);
  }

  100% {
    transform: translateY(112vh) rotate(300deg);
  }
}

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

@media (max-width: 760px) {
  .completion-shell {
    padding: 16px;
  }

  .completion-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .updated-pill {
    white-space: normal;
  }

  .completion-card {
    padding: 28px 18px;
  }

  h1 {
    font-size: 2.45rem;
  }

  .completion-card > p,
  .official-link-card a {
    font-size: 1.05rem;
  }

  .completion-actions,
  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .proof-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
