* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #F6F1E4;
  --panel-dark: #1B1030;
  --panel-dark-2: #331C57;
  --accent: #FFB238;
  --accent-hover: #F5A11E;
  --accent-ink: #7A4B00;
  --stamp-red: #E14D4D;
  --ink: #221528;
  --ink-soft: #6E6478;
  --ink-faint: #A79FB0;
  --input-fill: #F1EADA;
  --input-fill-focus: #FFFFFF;
  --border: #E4DAC3;
  --danger: #E14D4D;
  --surface-card: #FFFFFF;
  --font-display: "Lalezar", "Vazirmatn", sans-serif;
  --font-body: "Vazirmatn", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.page {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: 100vh;
}

/* ---------- Showcase (dark, exam-paper panel) ---------- */

.showcase {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 85% 0%, var(--panel-dark-2) 0%, var(--panel-dark) 55%);
  padding: 3.25rem 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
}

.showcase::before {
  /* faint graph-paper texture, like exam scratch paper */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
}

.showcase::after {
  /* giant watermark glyph -- "?" is literally what the brand name means */
  content: "؟";
  position: absolute;
  left: -4%;
  bottom: -14%;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 62vh;
  line-height: 1;
  color: rgba(255, 255, 255, 0.035);
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

.showcase__content {
  position: relative;
  z-index: 2;
  max-width: 460px;
}

.showcase__bottom {
  position: relative;
  z-index: 2;
}

.showcase__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2.5rem;
}

.logo-mark {
  width: 42px;
  height: 42px;
  display: block;
  flex-shrink: 0;
}

.logo-mark svg {
  width: 100%;
  height: 100%;
}

.showcase__wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.01em;
}

.showcase__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: rgba(255, 178, 56, 0.12);
  border: 1px solid rgba(255, 178, 56, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 1.4rem;
}

.showcase__tagline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 50px;
  line-height: 1.28;
  letter-spacing: 0.01em;
  margin-bottom: 1.1rem;
}

.showcase__tagline em {
  font-style: normal;
  color: var(--accent);
}

.showcase__desc {
  font-size: 15.5px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.62);
  max-width: 400px;
}

.showcase__stats {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 1.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat__num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 19px;
  color: var(--accent);
}

.stat__label {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
}

.stat__divider {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.14);
}

/* ---------- Signature element: the answer sheet (پاسخ‌نامه) — full-width ribbon ---------- */

.omr {
  position: relative;
  width: 100%;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 20px 24px 22px;
  backdrop-filter: blur(3px);
}

.omr__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.16);
}

.omr__title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.omr__code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  direction: ltr;
}

.omr__rows {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px 10px;
}

.omr__row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
}

.omr__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.omr__bubbles {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.omr__bubble {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  position: relative;
  flex-shrink: 0;
}

.omr__bubble--filled {
  background: var(--accent);
  border-color: var(--accent);
}

.omr__row--live .omr__bubble--live {
  animation: markBubble 4.5s ease-in-out infinite;
}

@keyframes markBubble {
  0%, 8% { background: transparent; border-color: rgba(255, 255, 255, 0.28); }
  35% { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px rgba(255, 178, 56, 0.22); }
  85% { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px rgba(255, 178, 56, 0.22); }
  100% { background: transparent; border-color: rgba(255, 255, 255, 0.28); box-shadow: none; }
}

.omr__stamp {
  position: absolute;
  bottom: -14px;
  left: 50%;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 12px;
  color: var(--stamp-red);
  background: rgba(30, 12, 6, 0.9);
  border: 1.5px solid var(--stamp-red);
  padding: 3px 10px;
  border-radius: 6px;
  transform: translateX(-50%) rotate(-8deg) scale(0.85);
  opacity: 0;
  animation: stampIn 4.5s ease-in-out infinite;
  pointer-events: none;
  white-space: nowrap;
  z-index: 3;
}

@keyframes stampIn {
  0%, 30% { opacity: 0; transform: translateX(-50%) rotate(-8deg) scale(0.6); }
  42% { opacity: 1; transform: translateX(-50%) rotate(-8deg) scale(1.05); }
  50% { transform: translateX(-50%) rotate(-8deg) scale(1); }
  82% { opacity: 1; }
  92%, 100% { opacity: 0; transform: translateX(-50%) rotate(-8deg) scale(0.9); }
}

/* ---------- Auth (ticket card) ---------- */

.auth {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2.5rem;
}

.auth::before {
  /* faint dotted ticket-paper texture so the margins read as designed, not empty */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(34, 21, 40, 0.07) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  pointer-events: none;
}

.auth::after {
  /* echo of the showcase watermark, tying both panels to the same brand idea */
  content: "؟";
  position: absolute;
  right: -8%;
  top: -12%;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 46vh;
  line-height: 1;
  color: rgba(34, 21, 40, 0.035);
  pointer-events: none;
  user-select: none;
}

.ticket-stack {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
}

.ticket-stack::before,
.ticket-stack::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  height: 100%;
  border-radius: 22px;
  background: var(--surface-card);
  border: 1px solid var(--border);
}

.ticket-stack::before {
  top: -10px;
  transform: rotate(-3.5deg);
  opacity: 0.9;
  z-index: 1;
}

.ticket-stack::after {
  top: -18px;
  transform: rotate(3deg);
  opacity: 0.7;
  z-index: 0;
}

.ticket {
  position: relative;
  z-index: 2;
  width: 100%;
  background: var(--surface-card);
  border-radius: 22px;
  overflow: visible;
  box-shadow: 0 30px 60px -25px rgba(34, 21, 40, 0.4);
}

.ticket__stub {
  background: var(--panel-dark);
  color: #fff;
  border-radius: 22px 22px 0 0;
  padding: 22px 28px 20px;
  position: relative;
}

.ticket__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ticket__brand-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticket__wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
}

.ticket__code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.4);
  direction: ltr;
}

.ticket__kicker {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.ticket__barcode {
  height: 22px;
  margin-top: 14px;
  border-radius: 3px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.9) 0px, rgba(255, 255, 255, 0.9) 2px,
    transparent 2px, transparent 5px,
    rgba(255, 255, 255, 0.9) 5px, rgba(255, 255, 255, 0.9) 6px,
    transparent 6px, transparent 8px,
    rgba(255, 255, 255, 0.9) 8px, rgba(255, 255, 255, 0.9) 11px,
    transparent 11px, transparent 13px,
    rgba(255, 255, 255, 0.9) 13px, rgba(255, 255, 255, 0.9) 14px,
    transparent 14px, transparent 17px
  );
  opacity: 0.5;
}

.ticket__perf {
  position: relative;
  height: 2px;
  background: var(--surface-card);
  border-top: 2px dashed var(--border);
  margin: 0;
}

.ticket__perf::before,
.ticket__perf::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  background: var(--bg);
  border-radius: 50%;
}

.ticket__perf::before {
  right: -13px;
}

.ticket__perf::after {
  left: -13px;
}

.ticket__body {
  padding: 30px 28px 26px;
}

.ticket__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 27px;
  letter-spacing: 0.005em;
  margin-bottom: 8px;
}

.ticket__subtitle {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 1.85rem;
}

.auth__form {
  display: flex;
  flex-direction: column;
}

.field {
  display: block;
  margin-bottom: 1.1rem;
}

.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 7px;
}

.field__input {
  width: 100%;
  height: 50px;
  background: var(--input-fill);
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.field__input::placeholder {
  color: var(--ink-faint);
}

.field__input:hover {
  background: var(--input-fill-focus);
}

.field__input:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
}

.field.field--invalid .field__input {
  border-color: var(--danger);
  background: #FDF1F1;
}

.field__input-wrap {
  position: relative;
  display: block;
}

.field__input-wrap .field__input {
  padding-left: 46px;
}

.field__toggle {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--ink-faint);
  cursor: pointer;
}

.field__toggle:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink-soft);
}

.field__toggle svg {
  width: 20px;
  height: 20px;
}

.field__error {
  display: none;
  font-size: 12.5px;
  color: var(--danger);
  margin-top: 6px;
}

.field.field--invalid .field__error {
  display: block;
}

.auth__forgot {
  align-self: flex-start;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 1.5rem;
}

.auth__forgot:hover {
  color: var(--accent-hover);
}

.btn {
  height: 52px;
  border: none;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 22px -10px rgba(255, 178, 56, 0.7);
}

.btn--primary:hover {
  background: var(--accent-hover);
  transform: rotate(-0.6deg) scale(1.01);
}

.btn--primary:active {
  transform: scale(0.98) rotate(0deg);
}

.btn__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(122, 75, 0, 0.35);
  border-top-color: var(--accent-ink);
  display: none;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn__spinner {
  display: inline-block;
}

.btn.is-loading .btn__label {
  opacity: 0.85;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth__note {
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: center;
  min-height: 0;
  margin-top: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.auth__note.is-visible {
  opacity: 1;
}

.auth__note.auth__note--error {
  color: var(--danger);
  font-weight: 600;
}

.auth__otp {
  display: block;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-hover);
  text-decoration: none;
  margin-top: 1.1rem;
}

.auth__otp:hover {
  text-decoration: underline;
}

.auth__divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-faint);
  font-size: 12.5px;
  margin: 1.6rem 0 1.25rem;
  padding: 0 28px 0;
}

.auth__divider::before,
.auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth__signup {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-soft);
  padding-bottom: 26px;
}

.auth__signup a {
  color: var(--accent-hover);
  font-weight: 700;
  text-decoration: none;
}

.auth__signup a:hover {
  text-decoration: underline;
}

/* shake animation for invalid submit */

.ticket.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .page {
    grid-template-columns: 1fr;
  }

  .showcase {
    min-height: 300px;
    padding: 2.25rem 1.5rem;
    justify-content: flex-start;
  }

  .showcase__tagline {
    font-size: 30px;
  }

  .showcase__desc {
    display: none;
  }

  .showcase__stats {
    gap: 14px;
    margin-bottom: 1.5rem;
  }

  .omr {
    display: none;
  }

  .showcase__bottom {
    margin-top: 1.5rem;
  }

  .auth {
    padding: 2rem 1.25rem 3rem;
  }

  .auth::after {
    font-size: 30vh;
  }

  .ticket-stack {
    max-width: 420px;
  }

  .ticket-stack::before,
  .ticket-stack::after {
    display: none;
  }
}

@media (max-width: 560px) {
  .showcase__brand {
    margin-bottom: 1.25rem;
  }

  .showcase__tagline {
    font-size: 25px;
  }

  .showcase__stats {
    flex-wrap: wrap;
  }

  .ticket__body {
    padding: 26px 20px 22px;
  }

  .ticket__stub {
    padding: 20px 20px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .omr__row--live .omr__bubble--live, .omr__stamp {
    animation: none;
  }
  .omr__stamp { opacity: 0; }

  .ticket.shake {
    animation: none;
  }
}