/*
  هوية نادي الحاسبات — جامعة أم القرى
  الألوان تُستبدل تلقائياً من لوحة السوبر أدمن (الهوية والألوان)
  الخط: FF Shamel Family Sans One (لو حطيت ملفاته في /assets/fonts) ثم IBM Plex Sans Arabic
*/
@font-face { font-family: 'Shamel Sans One'; src: local('FF Shamel Family Sans One'), local('ShamelFamilySansOne-Book'), url('/assets/fonts/ShamelSansOne-Book.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Shamel Sans One'; src: local('FF Shamel Family Sans One Bold'), local('ShamelFamilySansOne-Bold'), url('/assets/fonts/ShamelSansOne-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --deep: #2a636d;
  --teal: #358b9a;
  --gold: #9f895c;
  --dark: #0c272c;
  --paper: #f3f6f6;
  --sheet: #ffffff;
  --ink: #0c272c;
  --muted: #55707a;
  --rule: #d3dfe1;
  --ok: #1d7a4e;
  --bad: #b3261e;

  --metal-rule: linear-gradient(90deg, var(--gold), #e8dfc8 22%, #c8d6d9 45%, #ffffff 55%, var(--teal) 80%, var(--deep));
  --metal-gold: linear-gradient(115deg, #7d6a43 0%, var(--gold) 22%, #efe6cf 46%, var(--gold) 64%, #c9b88f 82%, #7d6a43 100%);
  --metal-dark: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0) 52%), linear-gradient(135deg, var(--dark), var(--deep));

  --head: 'Shamel Sans One', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --body: 'IBM Plex Sans Arabic', 'Shamel Sans One', system-ui, sans-serif;
  --r: 18px;
}

* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.75 var(--body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
body.loading main, body.loading .foot { visibility: hidden; }
.defs { position: absolute; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
h1, h2 { font-family: var(--head); font-weight: 700; line-height: 1.2; margin: 0; text-wrap: balance; }
[data-t] { white-space: pre-line; }
:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.st-teal { stop-color: var(--teal); } .st-deep { stop-color: var(--deep); } .st-gold { stop-color: var(--gold); }

.metal-rule { display: block; height: 4px; width: 150px; border-radius: 4px; background: var(--metal-rule); }

/* ── الزخارف ── */
body[data-pattern=diamonds] .hero, body[data-pattern=diamonds] .wb-head, body[data-pattern=diamonds] .r-top, body[data-pattern=diamonds] .foot {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='56' viewBox='0 0 64 56'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.09' stroke-width='1'%3E%3Cpath d='M22 10h20l8 9-18 21-18-21z'/%3E%3Cpath d='M14 19h36M26 19l6 21 6-21'/%3E%3C/g%3E%3Ccircle cx='0' cy='0' r='1.4' fill='%23ffffff' fill-opacity='.18'/%3E%3Ccircle cx='64' cy='56' r='1.4' fill='%23ffffff' fill-opacity='.18'/%3E%3C/svg%3E");
}
body[data-pattern=facets] .hero, body[data-pattern=facets] .wb-head, body[data-pattern=facets] .r-top, body[data-pattern=facets] .foot {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='70' viewBox='0 0 80 70'%3E%3Cpath d='M0 35L20 0h40l20 35-20 35H20zM20 0l20 35L60 0M20 70l20-35 20 35M0 35h80' fill='none' stroke='%23ffffff' stroke-opacity='.07'/%3E%3C/svg%3E");
}

/* ── الشريط العلوي ── */
.top { position: absolute; inset-inline: 0; top: 0; z-index: 3; color: #fff; }
.top-in { display: flex; justify-content: space-between; align-items: center; min-height: 76px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 46px; width: auto; }
.org { font-family: var(--head); font-weight: 700; font-size: 18px; }
.deadline { font-size: 14.5px; padding: 7px 16px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); font-variant-numeric: tabular-nums; }
.deadline b { font-weight: 600; color: #f1e8d3; }

/* ── الواجهة ── */
.hero {
  position: relative; isolation: isolate; color: #fff;
  background-color: var(--deep);
  padding: 120px 0 clamp(70px, 9vw, 120px);
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 70% at 18% 40%, rgba(255,255,255,.14), transparent 70%),
    radial-gradient(50% 60% at 100% 100%, var(--dark), transparent 75%);
}
.hero::after { content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 5px; background: var(--metal-rule); }
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 90px); align-items: center; }
.kicker { margin: 0 0 12px; color: #e6dcc3; font-weight: 600; font-size: 17px; }
h1 { font-size: clamp(36px, 5.2vw, 62px); max-width: 14ch; }
.hero .metal-rule { margin: 26px 0 0; width: 180px; }
.lede { font-size: 19px; color: #d8e8ea; max-width: 46ch; margin: 24px 0 36px; }

/* أزرار بأسلوب عناصر الهوية: كبسولة لامعة */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 17px/1 var(--body); padding: 17px 34px; border-radius: 999px;
  border: 0; cursor: pointer; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 24px -12px rgba(12,39,44,.7);
  transition: filter .2s, transform .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--metal-gold); color: var(--dark); }
.btn-dark { background: var(--metal-dark); color: #fff; outline: 1.5px solid transparent; }
.btn-dark:hover { outline-color: var(--gold); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.btn-wide { width: 100%; padding-block: 19px; }

/* ورقة الخطاب والختم */
.art { position: relative; margin: 0; }
.sheet {
  position: relative; aspect-ratio: 1 / 1.32; background: var(--sheet); color: var(--ink);
  border-radius: 6px; padding: 11% 10%;
  display: flex; flex-direction: column; gap: 4%;
  box-shadow: 0 40px 60px -30px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.4);
  transform: rotate(-2deg);
}
.sheet::before { content: ''; position: absolute; inset: 0 0 auto; height: 7px; border-radius: 6px 6px 0 0; background: var(--metal-rule); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5%; }
.sheet-logo { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, var(--deep), var(--teal)); }
.sheet-tag { font-size: clamp(11px, 1.1vw, 13px); font-weight: 600; color: var(--deep); border: 1px solid var(--rule); padding: 3px 10px; border-radius: 999px; }
.ln { display: block; height: 7px; border-radius: 4px; background: #e5ecee; width: 100%; }
.ln.strong { height: 12px; background: linear-gradient(90deg, #c9d9dc, #e5ecee); }
.w30 { width: 30%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }
.sheet-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-block: 2%; }
.sheet-table span { height: 22px; background: #eef3f4; border-radius: 4px; }
.sheet-table span:nth-child(-n+3) { background: #dce8ea; }
.sheet-sign { margin-top: auto; display: flex; justify-content: flex-end; }

.stamp {
  position: absolute; inset-inline-start: 50%; top: 56%; translate: 50% -50%;
  width: 48%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  color: var(--gold); font: 700 clamp(17px, 2.2vw, 25px)/1.35 var(--head);
  border: 3px solid var(--gold); outline: 1.5px solid var(--gold); outline-offset: -11px;
  background: radial-gradient(circle, rgba(255,255,255,.82) 56%, transparent 57%);
  rotate: -14deg; mix-blend-mode: multiply;
  animation: stamp .6s cubic-bezier(.2,.9,.3,1.25) .5s both;
}
@keyframes stamp { from { opacity: 0; scale: 1.7; } to { opacity: .95; scale: 1; } }

.gem { position: absolute; z-index: 2; filter: drop-shadow(0 14px 16px rgba(0,0,0,.35)); }
.gem-a { width: 92px; height: 80px; top: -36px; inset-inline-end: -22px; color: var(--teal); rotate: 12deg; }
.gem-b { width: 66px; height: 58px; bottom: 8%; inset-inline-start: -38px; rotate: -16deg; }
.gem-c { width: 40px; height: 35px; bottom: -14px; inset-inline-end: 22%; color: var(--gold); rotate: 8deg; }

/* ── الشروط ── */
.specs { padding-block: clamp(56px, 7vw, 88px) 40px; }
.specs h2 { font-size: clamp(26px, 3vw, 34px); color: var(--deep); }
.specs .metal-rule { margin: 14px 0 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px;
  background: #fff; border: 1px solid var(--rule); font-size: 15.5px;
}
.chip b { font-weight: 600; color: var(--deep); }
.chip svg { width: 18px; height: 16px; color: var(--teal); }
.rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; }
.rules:empty { display: none; }
.rules li { position: relative; padding-inline-start: 30px; color: #2b4a51; }
.rules li svg { position: absolute; inset-inline-start: 0; top: .55em; width: 17px; height: 15px; color: var(--gold); }

/* ── البوليصة ── */
.send { padding-block: 30px 110px; }
.waybill, .receipt, .closed {
  position: relative; max-width: 780px; margin-inline: auto; background: var(--sheet);
  border-radius: var(--r); box-shadow: 0 1px 0 var(--rule), 0 30px 60px -36px rgba(12,39,44,.45);
}
.wb-head, .r-top {
  position: relative; color: #fff; background-color: var(--deep);
  border-radius: var(--r) var(--r) 0 0; padding: 34px 38px 30px;
}
.wb-head::before, .r-top::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(120deg, rgba(255,255,255,.1), transparent 55%), radial-gradient(80% 120% at 0% 100%, var(--dark), transparent 70%); }
.wb-head > *, .r-top > * { position: relative; }
.wb-head h2 { font-size: clamp(24px, 3vw, 32px); }
.wb-head p { margin: 8px 0 0; color: #d4e5e8; font-size: 15.5px; max-width: 56ch; }
.wb-gem { position: absolute !important; inset-inline-end: 34px; top: 30px; width: 48px; height: 42px; filter: drop-shadow(0 8px 10px rgba(0,0,0,.3)); }

/* خط التمزيق مثل التذاكر */
.perf { position: relative; height: 0; border-top: 2px dashed var(--rule); margin-inline: 22px; }
.perf::before, .perf::after { content: ''; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); }
.perf::before { inset-inline-start: -35px; } .perf::after { inset-inline-end: -35px; }

.wb-row { border: 0; margin: 0; padding: 28px 38px 32px; border-bottom: 1px solid var(--rule); display: grid; gap: 16px; }
.wb-row:last-child { border-bottom: 0; }
legend { float: inline-start; width: 100%; padding: 0; margin-bottom: 4px; font: 700 19px/1.4 var(--head); color: var(--deep); display: flex; align-items: center; gap: 10px; }
.step { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--metal-gold); color: var(--dark); font: 700 15px/1 var(--body); box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }

.cells.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cell { display: grid; gap: 6px; }
.cell > span { font-size: 14.5px; font-weight: 500; color: var(--muted); }
.cell em { font-style: normal; font-weight: 400; }
input[type=text], input:not([type]), input[type=email], input[type=url], input[type=search], input[type=number], input[type=datetime-local], textarea, select {
  width: 100%; font: 400 16.5px/1.5 var(--body); color: var(--ink);
  background: var(--paper); border: 1.5px solid transparent; border-radius: 12px;
  padding: 13px 16px; transition: border-color .15s, background .15s;
}
input[dir=ltr] { text-align: left; }
input::placeholder, textarea::placeholder { color: #8ba0a6; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--teal); background: #fff; }
input[aria-invalid=true] { border-color: var(--bad); }
textarea { resize: vertical; min-height: 92px; }
.hint { font-size: 14px; color: var(--muted); }
.hint:empty { display: none; }
.hint.bad { color: var(--bad); } .hint.good { color: var(--ok); }

.drop {
  display: grid; justify-items: center; gap: 6px; text-align: center; padding: 36px 20px;
  border: 1.5px dashed #9db5ba; border-radius: var(--r); cursor: pointer; color: var(--muted);
  background: linear-gradient(180deg, #fbfdfd, #f3f8f8); transition: border-color .15s, background .15s;
}
.drop strong { color: var(--ink); font-weight: 600; }
.drop > span:last-child { font-size: 14.5px; }
.drop-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--metal-dark); color: #fff; margin-bottom: 6px; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.drop-ico svg { width: 26px; height: 26px; }
.drop:hover, .drop.over { border-color: var(--teal); background: #eaf4f5; }
.drop.disabled { opacity: .5; pointer-events: none; }

.files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.files:empty { display: none; }
.file { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px; background: #fff; }
.file .thumb { width: 46px; height: 46px; border-radius: 8px; background: var(--paper) center/cover; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--deep); }
.file .fname { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: right; }
.file .fstat { font-size: 13.5px; color: var(--muted); }
.file.ok .fstat { color: var(--ok); }
.file.bad { border-color: #e9b9b5; background: #fcf4f3; }
.file.bad .fstat { color: var(--bad); }
.bar-p { height: 3px; background: var(--rule); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.bar-p i { display: block; height: 100%; width: 0; background: var(--metal-rule); transition: width .15s; }
.file.ok .bar-p, .file.bad .bar-p { display: none; }
.x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.x:hover { background: var(--paper); color: var(--ink); }

.or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 16px; }
.check input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--deep); flex: none; }
.ts:empty { display: none; }
.msg { margin: 0; color: var(--bad); font-size: 15px; }
.msg:empty { display: none; }

/* الإيصال */
.r-top { text-align: center; padding-block: 40px 34px; }
.r-top .wb-gem { position: static !important; display: block; margin: 0 auto 12px; }
.r-label { margin: 0; color: #e6dcc3; font-weight: 600; }
.r-top h2 { font-size: clamp(28px, 3.4vw, 36px); margin-top: 4px; }
.r-body { padding: 30px 34px 38px; text-align: center; }
.r-body p { color: var(--muted); margin: 0; }
.r-code { margin: 22px auto 14px; display: inline-block; direction: ltr; font: 700 34px/1 var(--body); letter-spacing: .12em; padding: 18px 28px; border-radius: 14px; background: var(--paper); border: 1.5px dashed var(--deep); color: var(--deep); }
.barcode { display: flex; justify-content: center; gap: 2px; height: 56px; direction: ltr; }
.barcode i { display: block; background: var(--dark); }
.receipt:focus { outline: none; }
.stamp-in { animation: stamp .5s cubic-bezier(.2,.9,.3,1.25) both; }

.closed { padding: 50px 34px; text-align: center; }
.closed .wb-gem { position: static !important; display: block; margin: 0 auto 16px; }
.closed h2 { font-size: 30px; margin-bottom: 8px; color: var(--deep); }
.closed p { color: var(--muted); margin: 0; }

/* التذييل */
.foot { background-color: var(--dark); color: #c9dadd; font-size: 14.5px; position: relative; }
.foot::before { content: ''; position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--metal-rule); }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 34px 38px; }
.foot-gems { display: flex; gap: 8px; }
.foot-gems svg { width: 22px; height: 19px; }

.preview-note { background: var(--metal-gold); color: var(--dark); text-align: center; font-size: 14px; font-weight: 600; padding: 8px 16px; position: relative; z-index: 5; }

@media (max-width: 880px) {
  .hero-in { grid-template-columns: 1fr; }
  .art { width: min(340px, 78%); justify-self: center; order: -1; margin-bottom: 12px; }
  .rules { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 28px); }
  .hero { padding-top: 96px; }
  .cells.two { grid-template-columns: 1fr; }
  .wb-head, .wb-row { padding-inline: 20px; }
  .wb-gem { inset-inline-end: 18px; width: 38px; height: 33px; }
  .r-code { font-size: 25px; padding: 14px 18px; }
  .foot-in { flex-direction: column; text-align: center; }
  .org { font-size: 16px; }
  .deadline { font-size: 13px; padding: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* تعبئة الألماس */
.gem-a { fill: url(#g-teal); }
.gem-c { fill: url(#g-gold); }
.chip svg, .rules li svg { fill: currentColor; }
.a-gem { fill: var(--teal); }
.preview-note a { color: var(--dark); text-decoration: underline; }
