:root {
  --bg: #050816;
  --bg-elevated: rgba(15, 23, 42, 0.96);
  --card: rgba(15, 23, 42, 0.98);
  --border-subtle: rgba(148, 163, 184, 0.35);
  --border-strong: rgba(148, 163, 184, 0.7);
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --accent-strong: rgba(99, 102, 241, 0.35);
  --accent-alt: #f97316;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --muted-soft: rgba(148, 163, 184, 0.15);
  --error: #f97373;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-soft: 0 24px 80px rgba(15, 23, 42, 0.85);
  --shadow-subtle: 0 16px 40px rgba(15, 23, 42, 0.65);
  --blur: 24px;
  --font-ar: 'Tajawal', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-en: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: var(--font-ar);
}

body[data-lang='en'] {
  --font-sans: var(--font-en);
}

body[data-theme='light'] {
  --bg: #f3f4f6;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --border-subtle: rgba(148, 163, 184, 0.5);
  --border-strong: rgba(148, 163, 184, 0.9);
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --accent-strong: rgba(79, 70, 229, 0.18);
  --accent-alt: #f97316;
  --text: #111827;
  --muted: #6b7280;
  --muted-soft: rgba(156, 163, 175, 0.15);
  --error: #dc2626;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  background: radial-gradient(circle at top left, #1f2937, #020617 52%, #000000);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

body[data-theme='light'] {
  background: radial-gradient(circle at top left, #e5e7eb, #f9fafb 52%, #e5e7eb);
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.75;
  background:
    radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.35), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(244, 114, 182, 0.45), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(129, 140, 248, 0.5), transparent 55%);
  mix-blend-mode: screen;
  filter: blur(40px);
  z-index: -1;
}

body[data-theme='light'] .bg {
  opacity: 0.45;
  mix-blend-mode: normal;
}

.container {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.65),
    transparent
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

body[data-theme='light'] .topbar {
  background: linear-gradient(
    to bottom,
    rgba(249, 250, 251, 0.95),
    rgba(249, 250, 251, 0.9),
    transparent
  );
  border-bottom: 1px solid rgba(209, 213, 219, 0.9);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 14px;
  gap: 16px;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e5e7eb;
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.32), transparent 60%),
    radial-gradient(circle at 100% 0, rgba(244, 114, 182, 0.5), transparent 60%),
    linear-gradient(140deg, #111827, #020617);
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 10px 30px rgba(15, 23, 42, 0.9);
}

body[data-theme='light'] .brand__mark {
  background:
    radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.22), transparent 60%),
    radial-gradient(circle at 100% 0, rgba(244, 114, 182, 0.22), transparent 60%),
    linear-gradient(140deg, #f9fafb, #e5e7eb);
  border-color: rgba(209, 213, 219, 1);
  box-shadow:
    0 0 0 1px rgba(229, 231, 235, 1),
    0 10px 24px rgba(148, 163, 184, 0.5);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand__name {
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 15px;
}

.brand__tag {
  font-size: 12px;
  color: var(--muted);
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: var(--muted);
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.1), transparent 55%);
}

body[data-theme='light'] .pill {
  border-color: rgba(209, 213, 219, 1);
  background: #f9fafb;
}

.pill--visa {
  color: #f9fafb;
  background:
    linear-gradient(135deg, #1a1f71, #1a3fa8);
  border-color: #0f172a;
}

.pill--mc {
  color: #111827;
  background:
    radial-gradient(circle at 0 0, #ff5f00, #ffb347);
  border-color: #7f1d1d;
}

.pill--mada {
  color: #f9fafb;
  background:
    linear-gradient(135deg, #00a859, #00bcd4);
  border-color: #064e3b;
}

body[data-theme='light'] .pill--visa {
  color: #0f172a;
  background: linear-gradient(135deg, #e5edff, #c7d2fe);
  border-color: #4f46e5;
}

body[data-theme='light'] .pill--mc {
  color: #111827;
  background: linear-gradient(135deg, #fff7ed, #fed7aa);
  border-color: #f97316;
}

body[data-theme='light'] .pill--mada {
  color: #064e3b;
  background: linear-gradient(135deg, #dcfce7, #bae6fd);
  border-color: #22c55e;
}

.theme-toggle {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 4px 10px;
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.22), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 8px 22px rgba(15, 23, 42, 0.9);
}

.theme-toggle__icon {
  font-size: 14px;
}

body[data-theme='light'] .theme-toggle {
  background: linear-gradient(135deg, #f9fafb, #e5e7eb);
  color: #111827;
  box-shadow:
    0 0 0 1px rgba(209, 213, 219, 1),
    0 6px 16px rgba(148, 163, 184, 0.6);
}

.theme-toggle--logout {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
  border-color: rgba(248, 113, 113, 0.9);
}

body[data-theme='light'] .theme-toggle--logout {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #7f1d1d;
  border-color: rgba(248, 113, 113, 0.9);
}

.layout {
  display: flex;
  justify-content: center;
  padding: 32px 0 40px;
}

.main-card {
  flex: 1 1 0;
}

.login-card {
  max-width: 420px;
  margin-inline: auto;
  margin-bottom: 16px;
}

.card {
  position: relative;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.97));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.55);
  box-shadow: var(--shadow-soft);
  padding: 22px 22px 22px;
  overflow: hidden;
}

body[data-theme='light'] .card {
  background: #ffffff;
  border-color: rgba(209, 213, 219, 1);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: soft-light;
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(circle at 100% 0, rgba(244, 114, 182, 0.2), transparent 55%);
  opacity: 0.65;
}

body[data-theme='light'] .card::before {
  opacity: 0.15;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card__header {
  margin-bottom: 18px;
}

.h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 500;
}

.sub {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.sub2 {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.invoice-history {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.6);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.invoice-history__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.invoice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.invoice-row {
  display: grid;
  grid-template-columns: 2.2fr 1.3fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

body[data-theme='light'] .invoice-row {
  background: #f9fafb;
  border-color: rgba(209, 213, 219, 1);
}

.invoice-row__purpose {
  font-size: 14px;
  font-weight: 500;
}

.invoice-row__amount {
  font-size: 14px;
  color: var(--muted);
}

.invoice-row__link {
  font-size: 12px;
  color: var(--muted);
  direction: ltr;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-row__actions {
  display: flex;
  gap: 6px;
}

.btn.btn--small {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  border-radius: 999px;
  width: auto;
  color: var(--text);
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.8),
    0 6px 14px rgba(15, 23, 42, 0.9);
  background: rgba(15, 23, 42, 0.9);
}

body[data-theme='light'] .btn.btn--small {
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgba(209, 213, 219, 1),
    0 4px 10px rgba(148, 163, 184, 0.5);
}

.amount-box {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.7);
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.2), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(59, 130, 246, 0.18), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body[data-theme='light'] .amount-box {
  border-color: rgba(79, 70, 229, 0.7);
  background:
    radial-gradient(circle at 0 0, rgba(79, 70, 229, 0.08), transparent 55%),
    linear-gradient(135deg, #f9fafb, #ffffff);
}

.amount-box__label {
  font-size: 14px;
  color: var(--muted);
}

/* ================== Transaction details card ================== */
.transaction-card-inner {
  margin: 20px 0 0;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.82));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.45);
}

body[data-theme='light'] .transaction-card-inner {
  background: #ffffff;
  border-color: rgba(209, 213, 219, 0.95);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
}

.tx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.tx-header .sub {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
  color: #d1d5db;
  text-align: right;
  margin: 0;
}

.tx-header .tx-clear {
  color: var(--muted);
}

.tx-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tx-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.38);
}

body[data-theme='light'] .tx-row {
  background: #f8fafc;
  border-color: rgba(209, 213, 219, 0.9);
}

.tx-row dt {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tx-row dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.tx-row--amount {
  border-left: 4px solid var(--accent);
}

body[data-theme='light'] .tx-row--amount {
  border-left-color: #4f46e5;
}

.tx-list .divider {
  border-top: 1px dashed rgba(148, 163, 184, 0.4);
  margin: 2px 0;
}


.amount-box__value {
  font-size: 18px;
  font-weight: 600;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
select {
  appearance: none;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.98));
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    transform 0.08s ease;
}

body[data-theme='light'] input,
body[data-theme='light'] select {
  background: #f9fafb;
  border-color: rgba(209, 213, 219, 1);
}

input::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 1),
    0 0 0 1px rgba(129, 140, 248, 0.6),
    0 0 0 1.5px rgba(37, 99, 235, 0.45);
  transform: translateY(-0.5px);
}

input.error,
select.error {
  border-color: var(--error);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.8);
}

select {
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, #9ca3af 55%),
    linear-gradient(135deg, #9ca3af 45%, transparent 50%);
  background-position:
    calc(100% - 12px) 50%,
    calc(100% - 7px) 50%;
  background-size:
    7px 7px,
    7px 7px;
  background-repeat: no-repeat;
}

.hint {
  min-height: 14px;
  font-size: 12px;
  color: var(--muted);
}

.hint.error {
  color: var(--error);
}

.hint--error {
  min-height: 16px;
}

.divider {
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(148, 163, 184, 0.7),
    rgba(148, 163, 184, 0.85),
    transparent
  );
  margin: 2px 0 8px;
}

.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.row__title {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.row__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-logo {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: white;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 8px 20px rgba(15, 23, 42, 0.95);
}

body[data-theme='light'] .card-logo {
  box-shadow:
    0 0 0 1px rgba(209, 213, 219, 1),
    0 6px 14px rgba(148, 163, 184, 0.5);
}

.card-logo--visa {
  background: linear-gradient(135deg, #1a1f71, #1a55c3);
}

.card-logo--mc {
  background: radial-gradient(circle at 0 0, #ff5f00, #eb001b);
}

.card-logo--mada {
  background: linear-gradient(135deg, #00a859, #009ddc);
}

.card-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.card-input-wrapper input {
  padding-inline-end: 70px;
  direction: ltr;
  text-align: left;
}

.card-brand {
  position: absolute;
  inset-inline-end: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--muted);
  white-space: nowrap;
}

body[data-theme='light'] .card-brand {
  background: #f9fafb;
  border-color: rgba(209, 213, 219, 1);
}

.card-brand__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.9);
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.checkbox input[type='checkbox'] {
  width: 16px;
  height: 16px;
  border-radius: 6px;
  border-width: 1.25px;
  accent-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  width: 100%;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
  text-rendering: optimizeLegibility;
  background: linear-gradient(135deg, #4f46e5, #6366f1 40%, #22c55e);
  color: white;
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.75),
    0 14px 30px rgba(79, 70, 229, 0.65);
  transform: translateY(0);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
}

body[data-theme='light'] .btn {
  background: linear-gradient(135deg, #4f46e5, #6366f1 40%, #16a34a);
  box-shadow:
    0 0 0 1px rgba(79, 70, 229, 0.7),
    0 16px 32px rgba(148, 163, 184, 0.8);
}

.btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.85),
    0 18px 40px rgba(79, 70, 229, 0.8);
}

.btn:active {
  transform: translateY(0);
  box-shadow:
    0 0 0 1px rgba(79, 70, 229, 0.9),
    0 6px 18px rgba(55, 65, 81, 0.9);
}

.btn:disabled {
  cursor: default;
  opacity: 0.7;
  box-shadow:
    0 0 0 1px rgba(79, 70, 229, 0.75),
    0 8px 20px rgba(55, 65, 81, 0.9);
}

.btn__text {
  white-space: nowrap;
  letter-spacing: 0;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.28),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.btn__amount {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  background: radial-gradient(circle at 0 0, rgba(5, 150, 105, 0.65), rgba(34, 197, 94, 0.95));
  box-shadow:
    0 0 0 1px rgba(22, 163, 74, 0.9),
    0 8px 24px rgba(34, 197, 94, 0.85);
}

.btn--ghost {
  width: auto;
  padding-inline: 12px;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  border-radius: var(--radius-md);
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.8),
    0 10px 24px rgba(15, 23, 42, 0.9);
}

.btn--ghost .btn__amount {
  display: none;
}

.btn--ghost:hover {
  background: rgba(15, 23, 42, 0.95);
}

.btn--center {
  justify-content: center;
  width: 100%;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(14px);
}

.overlay[hidden] {
  display: none !important;
}

.overlay-card {
  width: min(420px, 100%);
  padding: 18px 16px 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.92));
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 1),
    0 18px 50px rgba(15, 23, 42, 0.9);
  text-align: center;
}

.otp-wrap {
  margin: 12px auto 12px;
  display: flex;
  justify-content: center;
}

.otp-input {
  width: min(280px, 100%);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  outline: none;
}

body[data-theme='light'] .otp-input {
  background: #ffffff;
  border-color: rgba(209, 213, 219, 1);
  color: var(--text);
}

.otp-input:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 1),
    0 0 0 1px rgba(129, 140, 248, 0.55),
    0 0 0 2px rgba(37, 99, 235, 0.35);
}

body[data-theme='light'] .overlay-card {
  background: linear-gradient(135deg, rgba(249, 250, 251, 0.98), rgba(255, 255, 255, 0.96));
  border-color: rgba(209, 213, 219, 1);
  box-shadow:
    0 0 0 1px rgba(229, 231, 235, 1),
    0 18px 50px rgba(148, 163, 184, 0.65);
}

.spinner {
  width: 54px;
  height: 54px;
  margin: 2px auto 12px;
  border-radius: 999px;
  border: 4px solid rgba(148, 163, 184, 0.25);
  border-top-color: rgba(99, 102, 241, 0.95);
  border-right-color: rgba(34, 197, 94, 0.9);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.success-card {
  width: min(460px, 100%);
  padding: 18px 16px 16px;
  border-radius: 22px;
  border: 1px solid rgba(34, 197, 94, 0.6);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(34, 197, 94, 0.6),
    0 18px 55px rgba(15, 23, 42, 0.92);
  background:
    radial-gradient(circle at 0 0, rgba(34, 197, 94, 0.18), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(99, 102, 241, 0.16), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 1),
    0 18px 55px rgba(15, 23, 42, 0.92);
  text-align: center;
}

body[data-theme='light'] .success-card {
  background:
    radial-gradient(circle at 0 0, rgba(34, 197, 94, 0.08), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(79, 70, 229, 0.08), transparent 55%),
    linear-gradient(135deg, rgba(249, 250, 251, 0.98), rgba(255, 255, 255, 0.96));
  border-color: rgba(22, 163, 74, 0.55);
  box-shadow:
    0 0 0 1px rgba(229, 231, 235, 1),
    0 18px 55px rgba(148, 163, 184, 0.65);
}


/* ── Rejected state ── */
.success-mark__svg--reject .success-mark__circle--reject {
  stroke: var(--color-error, #e53e3e);
  stroke-width: 2;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.success-mark__svg--reject .success-mark__check--reject {
  stroke: var(--color-error, #e53e3e);
  stroke-width: 2;
  stroke-linecap: round;
  animation: stroke 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
}

/* ── شاشة النجاح ── */
.success-card.success-card--success {
  border: 1px solid rgba(34, 197, 94, 0.6);
  background:
    radial-gradient(circle at 0 0, rgba(34, 197, 94, 0.16), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(99, 102, 241, 0.14), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
}

body[data-theme='light'] .success-card.success-card--success {
  border: 1px solid rgba(22, 163, 74, 0.55);
  background:
    radial-gradient(circle at 0 0, rgba(34, 197, 94, 0.08), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(79, 70, 229, 0.08), transparent 55%),
    linear-gradient(135deg, rgba(249, 250, 251, 0.98), rgba(255, 255, 255, 0.96));
}

/* ── شاشة الرفض ── */
.success-card.success-card--rejected,
.rejected-card {
  border: 1px solid rgba(239, 68, 68, 0.75) !important;
  background:
    radial-gradient(circle at 0 0, rgba(239, 68, 68, 0.18), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(239, 68, 68, 0.10), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
}

body[data-theme='light'] .success-card.success-card--rejected,
body[data-theme='light'] .rejected-card {
  border: 1px solid rgba(220, 38, 38, 0.75);
  background:
    radial-gradient(circle at 0 0, rgba(239, 68, 68, 0.08), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(239, 68, 68, 0.05), transparent 55%),
    linear-gradient(135deg, rgba(249, 250, 251, 0.98), rgba(255, 255, 255, 0.96));
}

.success-mark--rejected {
  filter: drop-shadow(0 14px 28px rgba(239, 68, 68, 0.28));
}

.rejected-card {
  width: min(460px, 100%);
  padding: 18px 16px 16px;
  border-radius: 22px;
  border: 2px solid rgba(220, 38, 38, 0.95) !important;
  background:
    radial-gradient(circle at 0 0, rgba(239, 68, 68, 0.22), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(239, 68, 68, 0.12), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.9));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(220, 38, 38, 0.6),
    0 18px 55px rgba(0, 0, 0, 0.42);
  text-align: center;
}

body[data-theme='light'] .rejected-card {
  border-color: rgba(220, 38, 38, 0.9) !important;
  background:
    radial-gradient(circle at 0 0, rgba(239, 68, 68, 0.13), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(239, 68, 68, 0.07), transparent 55%),
    linear-gradient(135deg, rgba(249, 250, 251, 0.98), rgba(255, 255, 255, 0.96));
}

.rejected-card .success-mark .success-mark__circle,
.rejected-card .success-mark .success-mark__check {
  stroke: rgba(220, 38, 38, 0.98) !important;
}

/* إزالة البوردرات من نص الحالة والترتيب */
.status-message {
  text-align: center;
  margin-bottom: 14px;
}

.status-message .h2 {
  margin: 0 0 8px;
  color: #f0fdf4;
}

body[data-theme='light'] .status-message .h2 {
  color: #b91c1c;
}

body[data-theme='light'] .status-message .sub,
body[data-theme='light'] .status-message .sub--detail {
  color: #1f2937;
}

body[data-theme='light'] .rejected-meta {
  border-color: rgba(220, 38, 38, 0.8);
  background: rgba(254, 226, 226, 0.7);
}

body[data-theme='light'] .success-card .status-message .h2 {
  color: #065f46;
}

body[data-theme='light'] .success-card .status-message .sub,
body[data-theme='light'] .success-card .status-message .sub--detail {
  color: #0f172a;
}

body[data-theme='light'] .status-meta {
  border-color: rgba(34, 197, 94, 0.8);
  background: rgba(220, 252, 231, 0.7);
}

body[data-theme='light'] .status-meta__label {
  color: #065f46;
}

body[data-theme='light'] .status-meta__value {
  color: #1f2937;
}

body[data-theme='light'] .rejected-meta .status-meta__label {
  color: #991b1b;
}

body[data-theme='light'] .rejected-meta .status-meta__value {
  color: #7f1d1d;
}

.status-message .sub {
  margin: 0;
  color: #d1fae5;
  font-weight: 500;
}

.status-message .sub--detail {
  color: #a7f3d0;
  margin-top: 6px;
}

.status-meta {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(34, 197, 94, 0.85);
  background: rgba(4, 120, 87, 0.28);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.25);
}

.rejected-meta {
  border-color: rgba(244, 63, 94, 0.9);
  background: rgba(220, 38, 38, 0.18);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.3);
}

.status-meta__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.status-meta__label {
  font-size: 13px;
  font-weight: 600;
  color: #bbf7d0;
}

.status-meta__value {
  font-size: 13px;
  font-weight: 700;
  color: #d9f99d;
}

.rejected-meta .status-meta__label {
  color: #fecaca;
}

.rejected-meta .status-meta__value {
  color: #fca5a5;
}

/* إعادة ضبط اللون الأحمر القسري لأيقونة الرفض */
.rejected-card .h2,
.rejected-card .sub,
.rejected-card .success-mark .success-mark__circle,
.rejected-card .success-mark .success-mark__check,
.success-mark--rejected .success-mark__circle,
.success-mark--rejected .success-mark__check,
.success-mark__circle--red,
.success-mark__check--red {
  color: #ef4444 !important;
  fill: none !important;
  stroke: #dc2626 !important;
}

/* حجم أيقونة النجاح/الرفض طبيعي */
.success-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
}
.success-mark__svg {
  width: 44px;
  height: 44px;
}

.success-mark .success-mark__circle,
.success-mark .success-mark__check {
  stroke-width: 2 !important;
}

/* إطار نصوص حالتي النجاح والرفض */
.success-card .sub,
.success-card .sub--detail,
.rejected-card .sub,
.rejected-card .sub--detail {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.14);
  padding: 8px 10px;
  border-radius: 10px;
  margin: 5px 0;
}

.sub--detail {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.92);
  line-height: 1.5;
}

.success-card .sub--detail,
.rejected-card .sub--detail {
  color: rgba(255, 255, 255, 0.9);
}

/* تلوين أيقونات الشعار بشكل واضح */
.success-mark .success-mark__circle,
.success-mark .success-mark__check {
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke: rgba(34, 197, 94, 0.95);
}

.success-mark--rejected .success-mark__circle,
.success-mark--rejected .success-mark__check,
.success-mark__circle--red,
.success-mark__check--red {
  stroke: rgba(239, 68, 68, 0.95) !important;
}

.success-mark__circle--red {
  stroke: rgba(239, 68, 68, 0.95) !important;
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: draw-red 0.55s ease forwards !important;
}

.success-mark__check--red {
  stroke: rgba(239, 68, 68, 0.98) !important;
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
  animation: draw-red 0.4s 0.45s ease forwards !important;
}

.success-mark--rejected {
  filter: drop-shadow(0 14px 28px rgba(239, 68, 68, 0.28)) !important;
}

@keyframes draw-red {
  to { stroke-dashoffset: 0; }
}