:root {
  --brand-0: #fff0f0;
  --brand-1: #FFD6D6;
  --brand-6: #D30000;
  --brand-7: #B00000;
  --brand-8: #800000;
  --brand-9: #3C0709;
  --surface-0: #FFFFFF;
  --surface-1: #F7F7F7;
  --surface-3: #EBEEED;
  --surface-9: #1F1F1F;
  --ink-1: #E0E0E0;
  --ink-2: #c4c4c4;
  --ink-3: #8E8E8E;
  --ink-5: #525252;
  --ink-7: #1F1F1F;
  --error-bg: #FFF5F5;
  --error-border: #FFA8A8;
  --error-text: #D30000;
  --success-bg: #E7F5EA;
  --success-border: #A3D9B1;
  --success-text: #106325;
  --radius: 8px;
  --radius-lg: 12px;
  --pill: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 10px 15px -5px rgba(0, 0, 0, 0.05), 0 7px 7px -5px rgba(0, 0, 0, 0.04);
  --font-display: 'Space Grotesk', 'Noto Sans Arabic', sans-serif;
  --font-body: 'Noto Sans', 'Noto Sans Arabic', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  color: var(--ink-7);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-nav {
  position: sticky;
  top: 0;
  z-index: 320;
  background: var(--surface-0);
  border-bottom: 1px solid var(--ink-1);
}

.auth-nav__inner {
  max-width: 1280px;
  margin-inline: auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: var(--brand-9);
}

.brand-mark__chip img {
  width: 30px;
  height: 30px;
}

.brand-mark__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.025em;
  color: var(--ink-7);
}

.lang-menu {
  position: relative;
}

.lang-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--ink-3);
  border-radius: var(--pill);
  background: var(--surface-0);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-7);
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu summary:hover {
  background: var(--surface-3);
}

.lang-menu[open] > ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 350;
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 150px;
  background: var(--surface-0);
  border: 1px solid var(--ink-1);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.lang-menu[open] > ul a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--ink-7);
}

.lang-menu[open] > ul a:hover {
  background: var(--surface-3);
}

.auth-main {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding: 40px 16px 64px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: stretch;
}

.auth-form-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 620px;
}

.section-heading__eyebrow {
  margin: 0;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--brand-6);
}

.section-heading__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink-7);
}

.section-heading__description {
  margin: 0;
  font-size: 16px;
  color: var(--ink-5);
}

.auth-card {
  background: var(--surface-0);
  border: 1px solid var(--ink-1);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.auth-alert {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
}

.auth-alert--error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}

.auth-alert--success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.auth-alert__title {
  font-family: var(--font-display);
  font-weight: 700;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-7);
}

.field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.field__hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-5);
}

.field input {
  width: 100%;
  height: 44px;
  padding-inline: 14px;
  border: 1px solid var(--ink-2);
  border-radius: var(--radius);
  background: var(--surface-0);
  color: var(--ink-7);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 150ms ease;
}

.field input:focus {
  border-color: var(--brand-6);
}

.field input[dir="ltr"] {
  text-align: start;
  direction: ltr;
}

html[dir="rtl"] .field input[dir="ltr"] {
  text-align: right;
}

.password-toggle {
  position: absolute;
  inset-inline-end: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}

.password-toggle:hover {
  background: var(--surface-3);
  color: var(--ink-7);
}

html[dir="rtl"] .field input.has-toggle {
  padding-left: 44px;
}

html[dir="ltr"] .field input.has-toggle {
  padding-right: 44px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.btn--primary {
  background: var(--brand-6);
  color: var(--surface-0);
  border-radius: var(--radius);
}

.btn--primary:hover {
  background: var(--brand-7);
}

.btn--secondary {
  background: var(--surface-0);
  color: var(--ink-7);
  border-color: var(--ink-3);
  border-radius: var(--pill);
}

.btn--secondary:hover {
  background: var(--surface-3);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-5);
  border-radius: var(--pill);
}

.btn--ghost:hover {
  background: var(--surface-3);
  color: var(--ink-7);
}

.btn--outline {
  background: var(--surface-0);
  color: var(--ink-7);
  border-color: var(--ink-7);
  border-radius: var(--pill);
}

.btn--outline:hover {
  background: var(--surface-3);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-3);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ink-1);
}

.auth-footnote {
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: var(--ink-5);
}

.auth-footnote a {
  font-weight: 700;
  color: var(--brand-6);
  transition: color 150ms ease;
}

.auth-footnote a:hover {
  color: var(--brand-7);
}

.auth-footnote a:focus-visible {
  outline: 2px solid var(--brand-6);
  outline-offset: 3px;
  border-radius: 4px;
}

.brand-panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: none;
  height: 100%;
  min-height: 460px;
  border-radius: var(--radius);
  background:
    radial-gradient(80% 62% at 88% 92%, var(--brand-6) 0%, transparent 46%),
    radial-gradient(110% 95% at 20% 58%, var(--brand-8) 0%, transparent 56%),
    radial-gradient(160% 150% at 12% 4%, #000000 0%, transparent 58%),
    var(--brand-9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 160px 26px rgba(0, 0, 0, 0.55);
  animation: panel-in 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand-panel__aurora {
  position: absolute;
  inset: -20%;
  z-index: 0;
  filter: blur(60px);
  opacity: 0.45;
  background:
    radial-gradient(40% 40% at 82% 80%, var(--brand-6) 0%, transparent 72%),
    radial-gradient(46% 46% at 58% 44%, var(--brand-8) 0%, transparent 76%);
  animation: aurora-drift 30s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
  from {
    transform: translate3d(-3%, 2%, 0) scale(1.04) rotate(0deg);
  }
  to {
    transform: translate3d(4%, -3%, 0) scale(1.16) rotate(-8deg);
  }
}

.brand-panel__grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.2;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.8'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23n)'/%3E%3C/svg%3E");
}

.brand-panel__watermark {
  position: absolute;
  inset-inline-end: -8%;
  bottom: -12%;
  z-index: 1;
  width: 56%;
  max-width: 300px;
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.09;
  filter: brightness(0) invert(1);
}

.brand-panel__watermark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-panel__lockup {
  position: absolute;
  top: clamp(20px, 6%, 44px);
  inset-inline-start: clamp(20px, 6%, 44px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.brand-panel__lockup img {
  width: 38px;
  height: 38px;
}

.brand-panel__lockup span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.025em;
  color: #FFFFFF;
}

.auth-footer {
  background: var(--surface-9);
  color: #FFFFFF;
  padding: 36px 16px;
  overflow: hidden;
}

.auth-footer__inner {
  max-width: 1280px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.auth-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}

.footer-brand .brand-mark__chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-brand .brand-mark__name {
  color: #FFFFFF;
}

.footer-brand__description {
  margin: 0;
  max-width: 448px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.65;
  color: #FFFFFF;
}

.footer-social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  color: #FFFFFF;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 4px;
  border-radius: 6px;
  color: #FFFFFF;
}

.contact-row__tile {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  inline-size: 34px;
  block-size: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  transition: background-color 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.contact-row:hover .contact-row__tile,
.contact-row:focus-visible .contact-row__tile {
  border-color: var(--brand-6);
  background: var(--brand-6);
  transform: translateY(-1px);
}

.contact-row:focus-visible {
  outline: 2px solid var(--brand-6);
  outline-offset: 3px;
}

.contact-row__body {
  display: flex;
  flex-direction: column;
}

.contact-row__number {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  direction: ltr;
  unicode-bidi: embed;
}

html[dir="rtl"] .contact-row__number {
  text-align: right;
}

.contact-row__meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.contact-row__email {
  font-size: 14px;
  font-weight: 500;
  direction: ltr;
  unicode-bidi: embed;
  word-break: break-all;
}

html[dir="rtl"] .contact-row__email {
  text-align: right;
}

.contact-row--light {
  color: var(--ink-7);
}

.contact-row--light .contact-row__tile {
  border-color: var(--ink-1);
  background: var(--surface-1);
  color: var(--ink-5);
}

.contact-row--light:hover .contact-row__tile,
.contact-row--light:focus-visible .contact-row__tile {
  border-color: var(--brand-6);
  background: var(--brand-6);
  color: var(--surface-0);
}

.contact-row--light .contact-row__meta {
  color: var(--ink-3);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 34px;
  block-size: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  transition: background-color 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.footer-social a:hover {
  border-color: var(--brand-6);
  background: var(--brand-6);
  transform: translateY(-1px);
}

.auth-footer__bottom {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-footer__copyright {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
}

.auth-footer__policies {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.auth-footer__policies a {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  transition: color 150ms ease;
}

.auth-footer__policies a:hover {
  color: var(--brand-1);
}

.auth-footer__policies a:focus-visible {
  outline: 2px solid var(--brand-6);
  outline-offset: 3px;
}

.doc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.doc-index {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--surface-0);
  border: 1px solid var(--ink-1);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.doc-index__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.doc-index__list {
  display: flex;
  flex-direction: column;
}

.doc-index__link {
  display: block;
  padding: 10px 14px;
  border-inline-start: 2px solid var(--ink-1);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-5);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.doc-index__link:hover {
  background: var(--surface-1);
  color: var(--ink-7);
}

.doc-index__link:focus-visible {
  outline: 2px solid var(--brand-6);
  outline-offset: -2px;
}

.doc-index__link.is-current {
  border-inline-start-color: var(--brand-6);
  border-inline-start-width: 3px;
  font-weight: 600;
  color: var(--ink-7);
}

.doc-article {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px;
  background: var(--surface-0);
  border: 1px solid var(--ink-1);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.doc-prose {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 68ch;
}

.doc-prose p {
  margin: 0;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-5);
}

.doc-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-1);
}

.doc-faq {
  border: 1px solid var(--ink-1);
  border-radius: var(--radius);
  overflow: hidden;
}

.doc-faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-7);
}

.doc-faq summary::-webkit-details-marker {
  display: none;
}

.doc-faq summary:hover {
  background: var(--surface-1);
}

.doc-faq summary svg {
  flex-shrink: 0;
  color: var(--ink-3);
  transition: transform 200ms ease;
}

.doc-faq[open] summary svg {
  transform: rotate(180deg);
}

.doc-faq__answer {
  margin: 0;
  padding: 0 16px 16px;
  max-width: 68ch;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-5);
}

.doc-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-inline-start: 16px;
  border-inline-start: 2px solid var(--brand-1);
}

.doc-block__label {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-7);
}

.doc-block__value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--brand-6);
}

.doc-block__body {
  margin: 0;
  max-width: 68ch;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-5);
}

.doc-empty {
  margin: 0;
  font-size: 15px;
  color: var(--ink-3);
}

.doc-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-6);
}

.doc-back:hover {
  color: var(--brand-7);
}

.doc-back svg {
  flex-shrink: 0;
}

html[dir="rtl"] .doc-back svg {
  transform: scaleX(-1);
}

@media (min-width: 992px) {
  .auth-nav__inner,
  .auth-main {
    padding-inline: 32px;
  }

  .auth-grid {
    grid-template-columns: 1fr 1fr;
  }

  .brand-panel {
    display: block;
  }

  .auth-footer {
    padding: 36px 32px;
  }

  .auth-footer__grid {
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 36px;
  }

  .auth-footer__bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .doc-layout {
    grid-template-columns: 264px 1fr;
    gap: 36px;
  }

  .doc-index {
    position: sticky;
    top: 88px;
  }

  .doc-article {
    padding: 36px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-panel,
  .brand-panel__aurora {
    animation: none;
  }

  .contact-row__tile,
  .footer-social a,
  .doc-index__link,
  .doc-faq summary svg {
    transition: none;
  }

  .contact-row:hover .contact-row__tile,
  .footer-social a:hover {
    transform: none;
  }
}
