:root {
  --paper: #ede9e6;
  --paper-2: #f7f4f0;
  --ink: #1e2a3a;
  --muted: #5c6b7c;
  --navy: #3d587b;
  --navy-deep: #2c415c;
  --blue: #8ea3b8;
  --line: rgba(61, 88, 123, 0.18);
  --gold: #9b784e;
  --gold-deep: #7d5e38;
  --danger: #8c3a32;
  --shadow: 0 24px 60px rgba(36, 48, 68, 0.08);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", "Helvetica Neue", sans-serif;
  --ar: "IBM Plex Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}

img { max-width: 100%; height: auto; }

.stage {
  min-height: 100vh;
  position: relative;
  overflow: clip;
}

.rail {
  position: fixed;
  top: 0;
  height: 100vh;
  width: min(16vw, 210px);
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.rail-left { left: 0; }
.rail-right {
  right: 0;
  top: -7vh;
  width: min(18.5vw, 246px);
  height: 114vh;
  transform: scaleX(-1);
  transform-origin: center center;
}

.page {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.masthead {
  text-align: center;
}

.partners {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.partners img {
  width: auto;
  object-fit: contain;
}

.logo-tec { height: 62px; }
.logo-dmc { height: 50px; }

.partner-rule {
  width: 1px;
  height: 54px;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
}

.event-mark {
  width: min(340px, 78%);
  margin: 16px auto 8px;
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 0;
}

.fact {
  background: rgba(247, 244, 240, 0.72);
  border: 1px solid var(--line);
  padding: 16px 14px 14px;
  text-align: center;
}

.fact .kicker {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 8px;
}

.fact .kicker .ar {
  font-family: var(--ar);
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.86rem;
  font-weight: 600;
}

.fact strong,
.fact span.value-en {
  display: block;
}

.fact strong {
  font-family: var(--ar);
  font-weight: 600;
  font-size: 1.02rem;
}

.fact .value-en {
  color: var(--muted);
  font-size: 0.95rem;
}

.register {
  margin-top: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 32px 32px 28px;
}

.intro {
  display: grid;
  gap: 6px;
  margin-bottom: 22px;
}

.intro .ar {
  font-family: var(--ar);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.7;
}

.intro .en {
  color: var(--navy-deep);
  font-size: 1.05rem;
}

.alert {
  border: 1px solid rgba(140, 58, 50, 0.35);
  background: #f8eeeb;
  color: var(--danger);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.alert p { margin: 0; }
.alert p + p { margin-top: 4px; }

.field { margin-bottom: 14px; }

.field label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 0.92rem;
}

.field label span {
  transition: color 0.45s ease;
}

.field label .ar {
  font-family: var(--ar);
  font-weight: 600;
}

.field label .en {
  color: var(--muted);
}

.field:focus-within label .en,
.field:focus-within label .ar {
  color: var(--gold-deep);
}

.field input {
  width: 100%;
  border: 1px solid rgba(61, 88, 123, 0.22);
  background:
    linear-gradient(var(--gold), var(--gold)) center bottom / 0 1px no-repeat,
    rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: 500 1rem/1.4 var(--sans);
  padding: 13px 14px;
  border-radius: 0;
  outline: none;
  transition:
    border-color 0.45s ease,
    box-shadow 0.5s ease,
    background-color 0.45s ease,
    background-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.field input:hover {
  border-color: rgba(155, 120, 78, 0.45);
}

.field input:focus {
  border-color: rgba(155, 120, 78, 0.7);
  background:
    linear-gradient(var(--gold), var(--gold)) center bottom / 100% 1px no-repeat,
    #fff;
  box-shadow: 0 14px 30px rgba(61, 88, 123, 0.07);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.actions { margin-top: 8px; }

button,
.button {
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--navy);
  color: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 14px 22px;
  width: 100%;
  transition: background-color 0.45s ease, box-shadow 0.45s ease;
}

.register button {
  background-color: var(--navy);
  background-image: linear-gradient(105deg, transparent 34%, rgba(255, 248, 236, 0.2) 50%, transparent 66%);
  background-repeat: no-repeat;
  background-size: 240% 100%;
  background-position: 120% 0;
  box-shadow: inset 0 0 0 rgba(155, 120, 78, 0);
  transition:
    background-color 0.45s ease,
    background-position 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s ease;
}

.register button:hover {
  background-color: var(--navy-deep);
  background-position: -20% 0;
  box-shadow: inset 0 2px 0 var(--gold);
}

button:hover,
.button:hover { background-color: var(--navy-deep); }

button:disabled { opacity: 0.72; cursor: wait; }

.button-ghost {
  display: inline-block;
  width: auto;
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
  text-decoration: none;
  padding: 8px 14px;
  font-size: 0.92rem;
}

.thanks {
  text-align: center;
}

.thanks .ar {
  font-family: var(--ar);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.7;
  margin: 0 0 10px;
}

.thanks .en {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 0;
  color: var(--navy-deep);
}

.qr-card {
  width: 220px;
  margin: 26px auto 8px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
  animation: rise 1.05s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.qr-card img { display: block; width: 100%; height: auto; }

.entry-code {
  letter-spacing: 0.12em;
  color: var(--navy);
  font-weight: 700;
  margin: 8px 0 0;
}

.note {
  margin: 18px auto 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.95rem;
}

.note .ar {
  font-family: var(--ar);
  display: block;
  margin-bottom: 4px;
}

.foot {
  margin-top: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
}

.admin-bar h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.7rem;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}

th {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 700;
}

.status-sent { color: #2d6a4f; }
.status-failed { color: var(--danger); }
.status-pending { color: var(--muted); }

.inline-form { display: inline; }
.inline-form button {
  width: auto;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.login-card {
  max-width: 420px;
  margin: 48px auto 0;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 28px;
  animation: rise 1.05s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.rail {
  animation: rail-in 1.8s ease both;
}

.partners img,
.partner-rule {
  animation: rise 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.logo-tec { animation-delay: 0.06s; }
.partner-rule { animation-delay: 0.16s; }
.logo-dmc { animation-delay: 0.26s; }

.event-mark {
  animation: rise 1.15s 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fact {
  animation: rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fact:nth-child(1) { animation-delay: 0.38s; }
.fact:nth-child(2) { animation-delay: 0.5s; }
.fact:nth-child(3) { animation-delay: 0.62s; }

.register {
  position: relative;
  animation: rise 1.05s 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.register::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  width: 84%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0);
  animation: draw 1.15s 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.register .intro {
  animation: rise 0.9s 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.register form .field,
.register form .actions {
  animation: rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.register form .field:nth-child(3) { animation-delay: 0.78s; }
.register form .field:nth-child(4) { animation-delay: 0.9s; }
.register form .field:nth-child(5) { animation-delay: 1.02s; }
.register form .field:nth-child(6) { animation-delay: 1.14s; }
.register form .actions { animation-delay: 1.26s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes draw {
  to { transform: scaleX(1); }
}

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

@media (max-width: 820px) {
  .rail { display: none; }
  .facts { grid-template-columns: 1fr; }
  .register { padding: 22px 16px 18px; }
  .logo-tec { height: 58px; }
  .logo-dmc { height: 48px; }
  .partners { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
