@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/assets/fonts/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61, U+1EE63, U+1EE65, U+1EE67, U+1EE6B, U+1EE6D, U+1EE6F, U+1EE71, U+1EE73, U+1EE75, U+1EE77, U+1EE79, U+1EE7B, U+1EE7D, U+1EE7F, U+1EE8A, U+1EE9C, U+1EEA0, U+1EEA5, U+1EEA7, U+1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/assets/fonts/cairo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/assets/fonts/cairo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --font: "Cairo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Code", Consolas, monospace;
  --bg: #f4faf6;
  --bg-tint: #eaf7ef;
  --surface: #ffffff;
  --surface-soft: #f2faf5;
  --surface-strong: #e5f5eb;
  --text: #0d2418;
  --text-soft: #3f5a4c;
  --muted: #697f73;
  --border: #dcebe2;
  --border-strong: #c5dfd0;
  --primary: #15803d;
  --primary-hover: #116a32;
  --primary-soft: #dcfce7;
  --primary-tint: #eefaf2;
  --accent: #22c55e;
  --btn-text: #ffffff;
  --danger: #c2410c;
  --danger-strong: #b91c1c;
  --danger-soft: #fff1ed;
  --danger-border: #f6cdbd;
  --warning: #b45309;
  --warning-soft: #fff7e6;
  --success: #15803d;
  --ring: rgba(21, 128, 61, 0.28);
  --shadow-sm: 0 1px 2px rgba(13, 57, 33, 0.05), 0 6px 18px -12px rgba(13, 57, 33, 0.18);
  --shadow-md: 0 18px 45px -28px rgba(13, 57, 33, 0.32), 0 2px 6px rgba(13, 57, 33, 0.04);
  --shadow-lg: 0 35px 80px -40px rgba(9, 52, 28, 0.4);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --header-h: 76px;
  --container: 1080px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07120c;
  --bg-tint: #0a1a11;
  --surface: #0d1e15;
  --surface-soft: #10241a;
  --surface-strong: #16301f;
  --text: #e9f7ee;
  --text-soft: #c0d8c8;
  --muted: #8fae9b;
  --border: #1c3526;
  --border-strong: #2a4a35;
  --primary: #34d399;
  --primary-hover: #6ee7b7;
  --primary-soft: rgba(52, 211, 153, 0.14);
  --primary-tint: rgba(52, 211, 153, 0.08);
  --accent: #34d399;
  --btn-text: #04220f;
  --danger: #fb923c;
  --danger-strong: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.1);
  --danger-border: rgba(248, 113, 113, 0.28);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.1);
  --success: #34d399;
  --ring: rgba(52, 211, 153, 0.3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 20px 50px -30px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--primary-soft);
  color: var(--text);
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.container {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  inset-block-start: -60px;
  inset-inline-start: 16px;
  z-index: 100;
  background: var(--surface);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  transition: inset-block-start 0.2s ease;
}

.skip-link:focus {
  inset-block-start: 14px;
}

/* Header */
.site-header {
  position: relative;
  z-index: 20;
  padding-block: 18px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--primary), #0b5d2c);
  color: #fff;
  box-shadow: 0 12px 26px -12px rgba(21, 128, 61, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  flex: none;
}

[data-theme="dark"] .brand-mark {
  background: linear-gradient(145deg, #34d399, #0f9f63);
  color: #04220f;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-text {
  display: grid;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  margin-block-start: 3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 7px 10px;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-switch button:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--primary-soft);
  color: var(--primary);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.theme-icon-moon {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: none;
}

[data-theme="dark"] .theme-icon-moon {
  display: block;
}

/* Buttons */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn-primary {
  --btn-bg: var(--primary);
  --btn-fg: var(--btn-text);
  box-shadow: 0 16px 32px -18px rgba(21, 128, 61, 0.8);
}

.btn-primary:hover:not(:disabled) {
  --btn-bg: var(--primary-hover);
}

.btn-soft {
  --btn-bg: var(--primary-soft);
  --btn-fg: var(--primary);
}

.btn-outline {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--muted);
  --btn-border: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  --btn-fg: var(--text);
  --btn-bg: var(--surface-soft);
}

.btn-danger {
  --btn-bg: var(--danger-strong);
  --btn-fg: #fff;
}

[data-theme="dark"] .btn-danger {
  --btn-fg: #1a0606;
}

.btn-danger-soft {
  --btn-bg: var(--danger-soft);
  --btn-fg: var(--danger-strong);
  --btn-border: var(--danger-border);
}

.btn-sm {
  min-height: 38px;
  padding: 0 13px;
  font-size: 0.82rem;
  border-radius: 11px;
}

.btn-block {
  width: 100%;
}

/* Cards / common */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-tint);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.alert svg {
  width: 19px;
  height: 19px;
  flex: none;
  margin-block-start: 1px;
}

.alert-danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger-strong);
}

.alert-warning {
  background: var(--warning-soft);
  border-color: rgba(180, 83, 9, 0.22);
  color: var(--warning);
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.muted {
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-block-start: 1px solid var(--border);
  margin-block-start: 70px;
  padding-block: 28px 36px;
  background: linear-gradient(180deg, transparent, var(--bg-tint));
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
  font-weight: 700;
}

.footer-brand svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Toasts */
.toast-stack {
  position: fixed;
  inset-inline: 16px;
  inset-block-end: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, 100%);
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  animation: toast-in 0.25s ease both;
}

[data-theme="dark"] .toast {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.toast svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.toast-error {
  background: var(--danger-strong);
  color: #fff;
}

.toast-success {
  background: var(--primary);
  color: var(--btn-text);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 20, 11, 0.55);
  backdrop-filter: blur(6px);
  animation: fade-in 0.18s ease both;
}

.modal {
  width: min(560px, 100%);
  max-height: min(88vh, 800px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s ease both;
  overflow: hidden;
}

.modal-lg {
  width: min(880px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-block-end: 1px solid var(--border);
}

.modal-head h3 {
  font-size: 1.05rem;
  font-weight: 800;
}

.modal-body {
  padding: 20px;
  overflow: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 20px;
  border-block-start: 1px solid var(--border);
  background: var(--surface-soft);
  flex-wrap: wrap;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Forms */
.field {
  display: grid;
  gap: 7px;
}

.field > label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-soft);
}

.input,
.select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.select {
  appearance: none;
  padding-inline-end: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

html[dir="rtl"] .select {
  background-position: 20px 21px, 15px 21px;
}

/* Skeleton */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-soft);
  border-radius: 10px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 1.4s infinite;
}

[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 66px;
  }
  .container {
    width: min(var(--container), calc(100% - 28px));
  }
  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }
  .brand-text strong {
    font-size: 0.98rem;
  }
  .brand-text small {
    font-size: 0.66rem;
  }
  .lang-switch button {
    padding: 6px 8px;
    font-size: 0.7rem;
  }
  .icon-btn {
    width: 42px;
    height: 42px;
  }
  .site-footer {
    margin-block-start: 46px;
  }
}

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