@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #050b14;
  --navy: #07111f;
  --navy-soft: #0b1829;
  --panel: rgba(11, 24, 41, .88);
  --panel-solid: #0d1c30;
  --field: #081424;
  --line: rgba(151, 171, 198, .14);
  --line-strong: rgba(218, 178, 97, .32);
  --gold: #d9b261;
  --gold-light: #f2d58f;
  --gold-deep: #a97727;
  --text: #f7f8fa;
  --muted: #8d9bb0;
  --green: #42d49b;
  --danger: #dc7b8d;
  --shadow: 0 28px 80px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 15% 0%, #102d4d 0, transparent 31%),
    radial-gradient(circle at 90% 42%, rgba(153,108,34,.13) 0, transparent 26%),
    var(--navy);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
  font-family: "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 65%, rgba(0,0,0,.22));
  z-index: -1;
}
.video-backdrop { position: fixed; inset: 0; z-index: -3; overflow: hidden; background: var(--navy); pointer-events: none; }
.video-backdrop video { width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: saturate(.75) contrast(1.08); transform: scale(1.015); transition: opacity 1.2s ease; }
.video-backdrop video.ready { opacity: .18; }
.video-backdrop span { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4,10,18,.67), rgba(5,13,24,.84) 48%, rgba(5,12,22,.95)), radial-gradient(circle at center, transparent, rgba(3,8,15,.38)); }
.ambient { position: fixed; pointer-events: none; border-radius: 50%; filter: blur(10px); opacity: .28; z-index: -1; }
.ambient-one { width: 520px; height: 520px; top: -330px; left: -120px; background: #194d78; }
.ambient-two { width: 420px; height: 420px; top: 430px; right: -320px; background: #9a6a1f; }

.site-header {
  height: 96px;
  padding: 0 max(28px, calc((100vw - 1320px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 12, 23, .78);
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 5;
}
.site-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: max(28px, calc((100vw - 1320px) / 2));
  width: 190px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.brand { display: flex; align-items: center; gap: 15px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(217,178,97,.25);
  border-radius: 14px;
  background: #000;
  box-shadow: 0 8px 24px rgba(0,0,0,.3), 0 0 0 3px rgba(217,178,97,.035);
}
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand b { font-size: 16px; letter-spacing: -.2px; }
.brand small { color: var(--gold-light); opacity: .74; font-size: 9px; margin-top: 4px; }
.status { font-size: 9px; color: #bac5d3; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(14,29,49,.75); }
.status span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-left: 8px; box-shadow: 0 0 0 4px rgba(66,212,155,.08), 0 0 14px var(--green); }

main { width: min(1320px, calc(100% - 48px)); margin: auto; padding-bottom: 70px; }
.hero { position: relative; text-align: center; padding: 68px 15px 48px; }
.hero::before {
  content: "أ";
  position: absolute;
  inset: 9px 0 auto;
  margin: auto;
  width: 124px;
  height: 124px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217,178,97,.07);
  color: rgba(217,178,97,.035);
  font-size: 75px;
  font-weight: 800;
  transform: rotate(45deg);
  z-index: -1;
}
.hero::before { line-height: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(217,178,97,.22); background: rgba(217,178,97,.055); color: var(--gold-light); font-size: 9px; }
.hero h1 { margin: 18px 0 9px; font-size: clamp(29px, 3.4vw, 45px); line-height: 1.5; letter-spacing: -1.8px; }
.hero h1 em { font-style: normal; color: var(--gold-light); }
.hero p { margin: 0; color: var(--muted); font-size: 11px; }

.template-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 22px; }
.template {
  min-height: 92px;
  padding: 17px;
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
  overflow: hidden;
  color: var(--text);
  text-align: right;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(15,31,52,.9), rgba(8,20,36,.9));
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
}
.template::before { content: ""; position: absolute; inset: auto -25px -45px auto; width: 100px; height: 100px; border: 1px solid rgba(255,255,255,.035); border-radius: 50%; }
.template:hover:not(:disabled) { transform: translateY(-3px); border-color: rgba(217,178,97,.32); }
.template.active { border-color: var(--gold); background: linear-gradient(135deg, rgba(217,178,97,.18), rgba(12,27,47,.96) 58%); box-shadow: 0 12px 32px rgba(0,0,0,.18), inset 0 0 28px rgba(217,178,97,.025); }
.template .icon { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #12243b; color: #aab7c9; font-size: 19px; }
.template.active .icon { color: #162238; border-color: transparent; background: linear-gradient(145deg, var(--gold-light), var(--gold-deep)); box-shadow: 0 8px 18px rgba(217,178,97,.16); }
.template > span:nth-child(2) { display: flex; flex-direction: column; }
.template b { font-size: 11px; }
.template small { color: var(--muted); font-size: 8px; margin-top: 5px; }
.template i { position: absolute; top: 11px; left: 12px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #122038; font-style: normal; font-size: 9px; }
.template.upcoming { opacity: .45; cursor: not-allowed; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); gap: 22px; align-items: start; }
.editor-panel, .preview-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: var(--panel); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.panel-title { height: 88px; padding: 0 25px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(255,255,255,.018), transparent); }
.panel-title > div { display: flex; align-items: center; gap: 13px; }
.panel-title h2 { margin: 0 0 4px; font-size: 13px; }
.panel-title p { margin: 0; color: var(--muted); font-size: 8px; }
.step { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: linear-gradient(145deg, rgba(217,178,97,.1), rgba(217,178,97,.02)); color: var(--gold-light); font: 700 9px Arial; }
.autosave { color: #7eddb8; font-size: 8px; }
.discord-badge { padding: 6px 8px; border: 1px solid rgba(88,101,242,.32); border-radius: 5px; color: #b9c0fa; background: rgba(88,101,242,.1); font: 700 7px Arial; letter-spacing: 1.2px; }

form { padding: 3px 25px 23px; }
fieldset { margin: 0; padding: 24px 0 27px; border: 0; border-bottom: 1px solid var(--line); }
legend { margin-bottom: 17px; color: #dce2ea; font-size: 10px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
label { display: flex; flex-direction: column; gap: 8px; }
label > span { color: #a7b3c4; font-size: 8px; }
label b { color: var(--gold); font-weight: 600; }
input, select, textarea { width: 100%; min-height: 45px; padding: 0 13px; border: 1px solid rgba(151,171,198,.2); border-radius: 9px; outline: none; color: #eef1f5; background: linear-gradient(180deg, rgba(6,17,31,.93), rgba(9,21,37,.93)); font: 500 10px "Noto Kufi Arabic", sans-serif; color-scheme: dark; transition: border-color .18s, box-shadow .18s, background .18s; }
textarea { padding-block: 12px; line-height: 1.8; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: rgba(151,171,198,.32); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); background: #09172a; box-shadow: 0 0 0 3px rgba(217,178,97,.07); }
input::placeholder, textarea::placeholder { color: #506079; }
.wide { grid-column: 1 / -1; }
.suffix-input { position: relative; }
.suffix-input input { padding-left: 52px; }
.suffix-input span { position: absolute; left: 12px; top: 11px; padding-right: 10px; border-right: 1px solid var(--line); color: #728299; font-size: 9px; }
.legend-row { display: flex; align-items: center; justify-content: space-between; }
.text-button { border: 0; color: var(--gold-light); background: none; font: 600 8px "Noto Kufi Arabic"; cursor: pointer; }
.approvals { display: flex; flex-direction: column; gap: 10px; }
.approval-row { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 9px; align-items: end; }
.approval-row label { gap: 5px; }
.remove-approval { width: 34px; height: 45px; border: 1px solid rgba(220,123,141,.18); border-radius: 8px; color: var(--danger); background: rgba(80,25,36,.16); cursor: pointer; font-size: 15px; }
.reset-button { display: block; margin: 18px auto 0; border: 0; color: #718199; background: none; font: 500 8px "Noto Kufi Arabic"; cursor: pointer; }

.preview-panel { position: sticky; top: 18px; }
.discord-card { min-height: 445px; margin: 25px 25px 16px; padding: 21px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: linear-gradient(145deg, #313338, #2b2d31); box-shadow: 0 18px 42px rgba(0,0,0,.27), inset 0 1px rgba(255,255,255,.025); }
.discord-top { display: flex; align-items: center; gap: 11px; direction: rtl; margin-bottom: 18px; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, var(--gold-light), var(--gold-deep)); color: #172237; font-weight: 800; box-shadow: 0 7px 17px rgba(0,0,0,.2); }
.discord-top > div { display: flex; flex-direction: column; }
.discord-top b { color: #f2f3f5; font: 700 11px Tahoma, Arial; }
.discord-top b i { margin-right: 5px; padding: 2px 4px; border-radius: 3px; color: white; background: #5865f2; font-style: normal; font-size: 7px; }
.discord-top small { margin-top: 4px; color: #949ba4; font: 8px Tahoma, Arial; }
pre { margin: 0; color: #dbdee1; white-space: pre-wrap; overflow-wrap: anywhere; direction: rtl; text-align: right; unicode-bidi: plaintext; font: 500 11px/1.95 Tahoma, Arial, sans-serif; }
.copy-button { width: calc(100% - 50px); height: 61px; margin: 0 25px; padding: 9px 19px; display: grid; grid-template-columns: 38px 1fr; grid-template-rows: 1fr 1fr; column-gap: 5px; border: 0; border-radius: 11px; color: #152036; background: linear-gradient(135deg, var(--gold-light), #c18d37); box-shadow: 0 10px 26px rgba(199,148,57,.18); text-align: right; font-family: "Noto Kufi Arabic"; cursor: pointer; transition: transform .2s, filter .2s; }
.copy-button:hover { transform: translateY(-2px); filter: brightness(1.05); }
.copy-button > span { grid-row: 1 / 3; align-self: center; font-size: 20px; }
.copy-button b { align-self: end; font-size: 10px; }
.copy-button small { align-self: start; opacity: .7; font-size: 7px; }
.copy-hint { padding: 12px 12px 21px; color: #63738b; text-align: center; font-size: 7px; }

.toast { position: fixed; z-index: 20; bottom: 25px; left: 25px; padding: 11px 15px; display: flex; align-items: center; gap: 10px; border: 1px solid #285a4d; border-radius: 11px; color: white; background: #102a27; box-shadow: 0 15px 35px rgba(0,0,0,.3); opacity: 0; transform: translateY(100px); transition: .3s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #0c231d; background: var(--green); font-weight: bold; }
.toast div { display: flex; flex-direction: column; }
.toast b { font-size: 9px; }
.toast small { margin-top: 2px; color: #89aa9f; font-size: 7px; }
[hidden] { display: none !important; }
footer { padding: 27px; border-top: 1px solid rgba(255,255,255,.045); color: #4e5d73; text-align: center; font-size: 7px; }
footer span { margin: 0 8px; color: var(--gold); }

@media (max-width: 940px) {
  .workspace { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .template-picker { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .site-header { height: 80px; padding: 0 16px; }
  .brand-mark { width: 46px; height: 46px; border-radius: 12px; }
  .brand b { font-size: 12px; }
  .brand small { font-size: 7px; }
  .status { display: none; }
  main { width: calc(100% - 28px); padding-bottom: 40px; }
  .hero { padding: 46px 4px 34px; }
  .hero h1 { font-size: 25px; letter-spacing: -1px; }
  .hero p { font-size: 9px; line-height: 1.9; }
  .template-picker { gap: 8px; }
  .template { min-height: 76px; padding: 11px; }
  .template .icon { width: 35px; height: 35px; flex-basis: 35px; font-size: 15px; }
  .template b { font-size: 9px; }
  .template small { display: none; }
  .panel-title { height: 78px; padding: 0 17px; }
  .autosave { display: none; }
  form { padding-inline: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .approval-row { grid-template-columns: 1fr 34px; }
  .approval-row label:nth-child(2) { grid-column: 1; }
  .approval-row .remove-approval { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .discord-card { margin: 17px 14px 14px; padding: 16px; }
  .copy-button { width: calc(100% - 28px); margin-inline: 14px; }
  .toast { right: 14px; left: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .video-backdrop video { display: none; }
}
