@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Jost:wght@300;400;500;600&family=El+Messiri:wght@500;600;700&family=Tajawal:wght@300;400;500;700&display=swap');

/* Brand palette from colors.jpg */
:root {
  --blue: #1e354d;
  --gold: #a88b55;
  --mist: #c8d5df;
  --burgundy: #631927;
  --black: #000000;
  --white: #ffffff;

  --blue-900: #0a121c; --blue-800: #101d2c; --blue-700: #16283b; --blue-500: #2c4a69;
  --gold-200: #f4e0ac; --gold-300: #dcc084; --gold-600: #876d3f; --gold-700: #6b5531;
  --burgundy-400: #8e2a3d; --burgundy-800: #3d0f18;

  --gold-grad: linear-gradient(110deg, var(--gold-600), var(--gold) 20%, var(--gold-200) 45%, var(--gold) 70%, var(--gold-600));
  --display: 'Cinzel', 'El Messiri', serif;
  --body: 'Jost', 'Tajawal', system-ui, sans-serif;
  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[lang='ar'] { --display: 'El Messiri', serif; --body: 'Tajawal', system-ui, sans-serif; }

:root[data-theme='dark'] {
  --bg: var(--blue-900);
  --bg-2: var(--blue-800);
  --surface: rgba(30, 53, 77, .42);
  --solid: #12202f;
  --line: rgba(168, 139, 85, .24);
  --text: #eef2f5;
  --muted: #9fb1c1;
  --accent: var(--gold-300);
  --shadow: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f6f4ef;
  --bg-2: #e7edf1;
  --surface: rgba(255, 255, 255, .78);
  --solid: #ffffff;
  --line: rgba(30, 53, 77, .16);
  --text: var(--blue);
  --muted: #56697c;
  --accent: var(--gold-700);
  --shadow: 0 24px 50px rgba(30, 53, 77, .16);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { font-family: var(--body); background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; min-height: 100vh; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.25; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
::selection { background: var(--burgundy); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--gold-700); border-radius: 10px; }

.gold-text {
  background: var(--gold-grad); background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite;
}
:root[data-theme='light'] .gold-text { background-image: linear-gradient(110deg, var(--gold-700), var(--gold) 45%, var(--burgundy) 60%, var(--gold-700)); }
@keyframes shine { to { background-position: -220% center; } }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .8rem 1.7rem; border-radius: 999px; border: 1px solid var(--line); overflow: hidden;
  font-weight: 500; letter-spacing: .04em; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.btn:hover { transform: translateY(-3px); border-color: var(--gold); }
.btn::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-130%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); transition: transform .7s var(--ease);
}
.btn:hover::after { transform: translateX(130%) skewX(-20deg); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.gold { background: var(--gold-grad); background-size: 200% auto; border-color: transparent; color: #1a1305; box-shadow: 0 10px 30px rgba(168, 139, 85, .35); }
.btn.red { background: linear-gradient(120deg, var(--burgundy-800), var(--burgundy-400)); color: #fff; border-color: transparent; }
.btn.small { padding: .4rem 1rem; font-size: .85rem; }
.btn.block { width: 100%; }

.icon-btn {
  position: relative; width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface); transition: .3s var(--ease);
}
.icon-btn:hover { border-color: var(--gold); color: var(--accent); transform: translateY(-2px); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

:root[data-theme='dark'] .sun-hide, :root[data-theme='light'] .moon-hide { display: none; }

.field { display: grid; gap: .35rem; font-size: .85rem; color: var(--muted); }
.field input, .field select, .field textarea, .input {
  width: 100%; padding: .75rem 1rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 1rem; transition: border-color .25s, box-shadow .25s;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(168, 139, 85, .18); }
select option { background: var(--solid); color: var(--text); }
.form { display: grid; gap: .9rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }

dialog {
  margin: auto; border: 1px solid var(--line); border-radius: 24px; background: var(--solid); color: var(--text);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: var(--shadow); overflow: auto;
}
dialog[open] { animation: pop .45s var(--ease); }
dialog::backdrop { background: rgba(3, 8, 14, .68); backdrop-filter: blur(7px); }
@keyframes pop { from { opacity: 0; transform: translateY(30px) scale(.94); } }
.dialog-body { padding: 1.8rem; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }

.toasts { position: fixed; inset-block-end: 22px; inset-inline: 0; display: grid; justify-items: center; gap: .5rem; z-index: 200; pointer-events: none; }
.toast { padding: .75rem 1.4rem; border-radius: 999px; background: var(--blue); color: #fff; border: 1px solid var(--gold); box-shadow: var(--shadow); animation: pop .4s var(--ease); transition: .4s; }
.toast.error { background: var(--burgundy); }
.toast.out { opacity: 0; transform: translateY(16px); }

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: reveal-circle .8s var(--ease); }
@keyframes reveal-circle { from { clip-path: circle(0 at var(--vx) var(--vy)); } to { clip-path: circle(150vmax at var(--vx) var(--vy)); } }

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