:root {
  --navy: #223f6b;
  --navy-dark: #142a49;
  --navy-deep: #0b1c34;
  --orange: #f49f0f;
  --green: #4fbb37;
  --pink: #e51c6f;
  --ink: #152238;
  --muted: #68758a;
  --paper: #ffffff;
  --soft: #f5f7fb;
  --line: #dfe5ee;
  --display: "RB", "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  --body: "RB", "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  --ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

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

button,
input {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.auth-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(420px, 46%) 1fr;
  min-height: 100svh;
  background: var(--paper);
}

.auth-visual {
  position: relative;
  min-height: 100svh;
  padding: 40px clamp(30px, 4vw, 68px);
  color: var(--paper);
  background: var(--navy-deep);
  overflow: hidden;
  isolation: isolate;
}

.auth-visual > img,
.visual-wash,
.visual-grid {
  position: absolute;
  inset: 0;
}

.auth-visual > img {
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% center;
  animation: imageArrival 1.3s var(--ease) both;
}

.visual-wash {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(8, 22, 42, 0.4), rgba(8, 22, 42, 0.94)),
    linear-gradient(90deg, rgba(8, 22, 42, 0.72), transparent 70%);
}

.visual-grid {
  z-index: -1;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  color: var(--paper);
  background: var(--navy);
  box-shadow: 0 12px 30px rgba(10, 27, 51, 0.2);
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
}

.brand-mark span {
  color: var(--orange);
}

.auth-brand > span:last-child {
  display: grid;
  line-height: 1.05;
}

.auth-brand strong {
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 800;
}

.auth-brand small {
  margin-top: 5px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  opacity: 0.65;
  text-transform: uppercase;
}

/* The wordmark carries the name, so it stands alone in place of mark + text. */
.auth-brand-logo {
  display: block;
  width: auto;
  height: 54px;
}

.brand-mobile .auth-brand-logo {
  height: 40px;
}

.brand-on-image .brand-mark {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

/*
 * Centred in the space the logo and the two cards leave behind, rather than
 * pinned to one edge: auto margins against both insets put it in the middle of
 * that gap at any screen height. The centring uses margins, not a transform, so
 * it does not fight the arrival animation.
 */
.visual-copy {
  position: absolute;
  top: 125px;
  bottom: 205px;
  height: fit-content;
  margin-block: auto;
  left: clamp(30px, 4vw, 68px);
  max-width: 570px;
  padding-right: 45px;
  animation: copyArrival 0.9s 0.18s var(--ease) both;
}

.mini-label,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--orange);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Bigger than the kicker it shares its base rule with. */
.mini-label {
  font-size: 0.95rem;
}

.mini-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(79, 187, 55, 0.17);
  animation: pulse 2.2s ease-in-out infinite;
}

/*
 * The tight tracking and the 0.88 leading were squeezing the two lines into each
 * other, and the last line ran past the foot of the panel. Roomier letters, a
 * line height that clears the descenders, and a smaller ceiling so it fits.
 */
.visual-copy h1 {
  margin: 16px 0 20px;
  font-family: var(--display);
  font-size: clamp(3rem, 4.6vw, 5.1rem);
  font-weight: 800;
  letter-spacing: -0.005em;
  line-height: 1.12;
}

/*
 * Arabic carries its marks above and below the line, so the two lines run into
 * each other at a leading that suits Latin capitals.
 */
html[dir="rtl"] .visual-copy h1 {
  line-height: 1.45;
}

.visual-copy h1 em {
  color: var(--orange);
  font-style: normal;
}

.visual-copy p {
  max-width: 510px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(0.96rem, 1.2vw, 1.08rem);
  line-height: 1.75;
}

.visual-note {
  position: absolute;
  bottom: 110px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(15px);
  animation: noteArrival 0.8s 0.55s var(--ease) both;
}

.note-one {
  left: clamp(30px, 4vw, 68px);
}

.note-two {
  right: clamp(30px, 4vw, 68px);
}

.note-icon {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
}

.note-icon.orange {
  color: var(--navy-deep);
  background: var(--orange);
}

.note-icon.green {
  color: var(--paper);
  background: var(--green);
}

.note-icon svg {
  width: 19px;
  stroke-width: 2.4;
}

.visual-note > span:last-child {
  display: grid;
  gap: 3px;
}

.visual-note strong {
  font-family: var(--display);
  font-size: 0.78rem;
}

.visual-note small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.66rem;
}

.shape {
  position: absolute;
  border-radius: 10px;
  animation: shapeFloat 5s ease-in-out infinite;
}

.auth-visual .shape-orange {
  top: 14%;
  inset-inline-end: 8%;
  width: 22px;
  height: 22px;
  background: var(--orange);
  rotate: 16deg;
}

/*
 * Kept on the side the headline runs away from - the right in English, the left
 * in Arabic - so it never lands on top of the first letter.
 */
.auth-visual .shape-pink {
  top: 35%;
  inset-inline-end: 11%;
  width: 13px;
  height: 38px;
  background: var(--pink);
  rotate: -22deg;
  animation-delay: -2s;
}

.auth-main {
  position: relative;
  display: grid;
  min-height: 100svh;
  align-content: center;
  padding: 40px clamp(28px, 7vw, 120px) 36px;
  background:
    radial-gradient(circle at 100% 0, rgba(244, 159, 15, 0.08), transparent 28%),
    radial-gradient(circle at 0 100%, rgba(79, 187, 55, 0.07), transparent 28%),
    var(--paper);
}

.auth-topbar {
  position: absolute;
  top: 35px;
  right: clamp(28px, 6vw, 90px);
  left: clamp(28px, 6vw, 90px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.brand-mobile {
  display: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  transition: color 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
  color: var(--navy);
  transform: translateX(-3px);
}

.back-link svg {
  width: 18px;
}

/* Both languages spelled out, so either one can be picked at a glance. */
.auth-language {
  position: absolute;
  top: 22px;
  inset-inline-end: clamp(28px, 7vw, 120px);
  z-index: 3;
}

.auth-card {
  width: min(100%, 480px);
  margin: auto;
  animation: cardArrival 0.85s 0.1s var(--ease) both;
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-heading h2,
.recovery-panel h1 {
  margin: 10px 0 16px;
  color: var(--navy);
  font-family: var(--display);
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.005em;
  line-height: 1.08;
}

.auth-heading .section-kicker {
  font-size: 0.92rem;
}

.auth-heading p,
.recovery-panel > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.auth-form {
  display: grid;
  gap: 20px;
}

.auth-error {
  margin: -12px 0 18px;
  padding: 13px 15px;
  border: 1px solid rgba(229, 28, 111, 0.2);
  border-radius: 14px;
  color: #a30e4e;
  background: rgba(229, 28, 111, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
}

/* Sits on the label's own line, hard against the right edge of the field. */
.field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}

.field-head > label {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 9px;
}

.field > span:first-child {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

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

/* Logical, so in Arabic the field icon moves to the right and the eye button to
   the left instead of both crowding the same edge. */
.input-wrap > svg {
  position: absolute;
  inset-inline-start: 17px;
  width: 20px;
  color: #8792a3;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  height: 57px;
  padding: 0 48px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  background: #fbfcfe;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-wrap input::placeholder {
  color: #a5adba;
}

.input-wrap input:focus {
  border-color: rgba(34, 63, 107, 0.65);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(34, 63, 107, 0.08);
}

.password-toggle {
  position: absolute;
  inset-inline-end: 13px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #8792a3;
  background: transparent;
}

.password-toggle:hover {
  color: var(--navy);
  background: rgba(34, 63, 107, 0.06);
}

.password-toggle svg {
  width: 19px;
}

.password-toggle .eye-closed,
.password-toggle.is-visible .eye-open {
  display: none;
}

.password-toggle.is-visible .eye-closed {
  display: block;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -2px;
  font-size: 0.81rem;
}

.form-options > a,
.legal-copy a,
.auth-support a,
.text-back-link,
.recovery-links button {
  color: var(--navy);
  font-weight: 700;
}

.form-options > a:hover,
.legal-copy a:hover,
.auth-support a:hover,
.text-back-link:hover {
  color: var(--pink);
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  cursor: pointer;
}

.check-row input {
  position: absolute;
  opacity: 0;
}

.custom-check {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  transition: all 0.2s ease;
}

.custom-check svg {
  width: 12px;
  color: var(--paper);
  opacity: 0;
  stroke-width: 2.6;
}

.check-row input:checked + .custom-check {
  border-color: var(--navy);
  background: var(--navy);
}

.check-row input:checked + .custom-check svg {
  opacity: 1;
}

/*
 * Log in and Forgot password share the row evenly, and the way back to the site
 * sits under them - the top bar that used to carry it is gone.
 */
.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.secondary-auth-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--navy);
  background: var(--paper);
  font-size: 0.84rem;
  font-weight: 800;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s var(--ease);
}

.secondary-auth-button:hover {
  border-color: rgba(34, 63, 107, 0.45);
  background: rgba(34, 63, 107, 0.05);
  transform: translateY(-2px);
}

.auth-back {
  width: 100%;
  margin-top: 2px;
}

.auth-back svg {
  width: 16px;
}

/* The arrow points the way the language runs. */
html[dir="rtl"] .auth-back svg {
  transform: scaleX(-1);
}

.primary-auth-button {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 13px;
  color: var(--paper);
  background: var(--navy);
  box-shadow: 0 12px 26px rgba(34, 63, 107, 0.2);
  font-size: 0.84rem;
  font-weight: 800;
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease, background 0.25s ease;
}

.primary-auth-button:hover {
  background: var(--navy-dark);
  box-shadow: 0 18px 38px rgba(34, 63, 107, 0.3);
  transform: translateY(-2px);
}

.primary-auth-button svg {
  width: 18px;
  transition: transform 0.25s ease;
}

.primary-auth-button:hover svg {
  transform: translateX(4px);
}

.legal-copy {
  margin: 25px 0 0;
  color: #8a95a5;
  font-size: 0.73rem;
  line-height: 1.6;
  text-align: center;
}

.auth-support {
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Password recovery */
.recovery-page {
  color: var(--paper);
  background: var(--navy-deep);
}

.recovery-backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.recovery-backdrop::before {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 62px 62px;
  content: "";
  mask-image: radial-gradient(circle at center, black, transparent 70%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  animation: orbFloat 9s ease-in-out infinite;
}

.orb-one {
  top: -12vw;
  left: -10vw;
  width: 36vw;
  height: 36vw;
  background: radial-gradient(circle at 60% 60%, rgba(79, 187, 55, 0.24), transparent 67%);
}

.orb-two {
  right: -9vw;
  bottom: -16vw;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle at 40% 40%, rgba(229, 28, 111, 0.24), transparent 68%);
  animation-delay: -3s;
}

.orb-three {
  top: 14%;
  right: 7%;
  width: 26vw;
  height: 26vw;
  background: radial-gradient(circle, rgba(244, 159, 15, 0.15), transparent 66%);
  animation-delay: -6s;
}

.simple-auth-header {
  position: relative;
  z-index: 2;
  display: flex;
  max-width: 1380px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 28px 38px;
}

.simple-auth-header .brand-mark {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.09);
}

.simple-auth-header .back-link {
  color: rgba(255, 255, 255, 0.65);
}

.simple-auth-header .back-link:hover {
  color: var(--paper);
}

.recovery-main {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: calc(100svh - 105px);
  place-items: center;
  padding: 35px 20px 50px;
}

.recovery-card {
  position: relative;
  width: min(100%, 610px);
  min-height: 650px;
  padding: 40px 58px 46px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 28px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.3);
  animation: cardArrival 0.8s var(--ease) both;
  overflow: hidden;
}

.recovery-card::after {
  position: absolute;
  top: -70px;
  right: -70px;
  width: 160px;
  height: 160px;
  border: 32px solid rgba(244, 159, 15, 0.09);
  border-radius: 50%;
  content: "";
}

.recovery-progress {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: start;
  margin: 25px 10px 44px;
}

.recovery-progress > i {
  height: 2px;
  margin-top: 16px;
  background: var(--line);
}

.progress-step {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #a0a8b5;
}

.progress-step span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font-size: 0.73rem;
  font-weight: 800;
  transition: all 0.35s var(--ease);
}

.progress-step small {
  font-size: 0.65rem;
  font-weight: 700;
}

.progress-step.is-current,
.progress-step.is-complete {
  color: var(--navy);
}

.progress-step.is-current span {
  border-color: var(--orange);
  box-shadow: 0 0 0 6px rgba(244, 159, 15, 0.1);
}

.progress-step.is-complete span {
  color: var(--paper);
  border-color: var(--green);
  background: var(--green);
}

.recovery-panels {
  position: relative;
}

.recovery-panel {
  display: none;
  text-align: center;
}

.recovery-panel.is-active {
  display: block;
  animation: panelArrival 0.5s var(--ease) both;
}

.recovery-icon {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 22px;
  place-items: center;
  border-radius: 21px;
  rotate: -3deg;
}

.recovery-icon svg {
  width: 29px;
  stroke-width: 1.7;
}

.icon-orange {
  color: #8d5700;
  background: rgba(244, 159, 15, 0.17);
}

.icon-green {
  color: #29751a;
  background: rgba(79, 187, 55, 0.16);
}

.icon-pink {
  color: #a30e4e;
  background: rgba(229, 28, 111, 0.13);
}

.recovery-panel h1 {
  font-size: clamp(1.9rem, 5vw, 2.55rem);
}

.recovery-panel > p {
  max-width: 440px;
  margin-right: auto;
  margin-left: auto;
  font-size: 0.92rem;
}

.recovery-panel > p strong {
  color: var(--navy);
}

.compact-form {
  margin-top: 28px;
  text-align: left;
}

.field-message {
  min-height: 0;
  margin: -12px 2px 0;
  color: var(--pink);
  font-size: 0.72rem;
  font-weight: 600;
}

.field-message:not(:empty) {
  min-height: 16px;
}

/* Same slot, but for a confirmation rather than a problem. */
.field-message.field-notice {
  color: var(--green);
}

.text-back-link {
  display: inline-block;
  margin-top: 22px;
  font-size: 0.78rem;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 7px;
}

.code-grid input {
  width: 100%;
  min-width: 0;
  height: 55px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--navy);
  background: #fbfcfe;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
  transition: all 0.2s ease;
}

.code-grid input:focus {
  border-color: var(--orange);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(244, 159, 15, 0.11);
  transform: translateY(-2px);
}

.recovery-links {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.recovery-links button {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.76rem;
}

.recovery-links button:hover {
  color: var(--pink);
}

.password-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: -12px;
}

.password-meter i {
  height: 4px;
  border-radius: 8px;
  background: var(--line);
  transition: background 0.25s ease;
}

.password-meter[data-strength="1"] i:nth-child(1) { background: var(--pink); }
.password-meter[data-strength="2"] i:nth-child(-n+2) { background: var(--orange); }
.password-meter[data-strength="3"] i:nth-child(-n+3) { background: var(--green); }
.password-meter[data-strength="4"] i { background: var(--green); }

.success-ring {
  display: grid;
  width: 100px;
  height: 100px;
  margin: 55px auto 30px;
  place-items: center;
  border: 2px solid rgba(79, 187, 55, 0.35);
  border-radius: 50%;
  color: var(--paper);
  background: var(--green);
  box-shadow: 0 0 0 12px rgba(79, 187, 55, 0.08), 0 20px 40px rgba(79, 187, 55, 0.22);
  animation: successPop 0.6s var(--ease) both;
}

.success-ring svg {
  width: 45px;
  stroke-width: 2.2;
}

.recovery-success .primary-auth-button {
  max-width: 330px;
  margin: 30px auto 0;
}

.recovery-footer {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 23px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 600;
}

.recovery-footer a:hover {
  color: var(--paper);
}

.recovery-footer span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--orange);
}

.shake {
  animation: shake 0.4s ease;
}

/* Terms */
.terms-page {
  color: var(--ink);
  background: var(--paper);
}

/*
 * Built to read as the homepage bar in its scrolled state - same height, blur,
 * shadow, and pill buttons - and it sticks to the top so it stays reachable all
 * the way down a long terms page.
 */
.terms-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(24px, 4.5vw, 72px);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 35px rgba(14, 34, 60, 0.1);
  backdrop-filter: blur(18px);
}

/* The brand mark on this page is the logo itself, at the header's own size. */
.terms-brand img {
  display: block;
  width: auto;
  height: 52px;
}

.terms-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* The same pair of pills the homepage header carries: outlined, then filled. */
.terms-header .back-link {
  padding: 12px 18px;
  border: 1px solid rgba(34, 63, 107, 0.18);
  border-radius: 999px;
  color: var(--navy);
  font-size: 0.83rem;
  font-weight: 700;
  transition: background 0.25s ease, transform 0.25s ease;
}

.terms-header .back-link:hover {
  background: rgba(34, 63, 107, 0.07);
  transform: translateY(-2px);
}

.terms-login {
  padding: 12px 18px;
  border-radius: 999px;
  color: var(--paper);
  background: var(--navy);
  font-size: 0.83rem;
  font-weight: 700;
  transition: transform 0.25s ease;
}

.terms-login:hover {
  transform: translateY(-2px);
}

.terms-hero {
  position: relative;
  min-height: 480px;
  padding: 95px clamp(24px, 10vw, 160px);
  color: var(--paper);
  background:
    radial-gradient(circle at 85% 15%, rgba(229, 28, 111, 0.26), transparent 28%),
    radial-gradient(circle at 15% 85%, rgba(79, 187, 55, 0.18), transparent 30%),
    var(--navy-deep);
  overflow: hidden;
}

.terms-orbit {
  position: absolute;
  top: -270px;
  right: -120px;
  width: 610px;
  height: 610px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(255, 255, 255, 0.025),
    0 0 0 140px rgba(255, 255, 255, 0.018);
}

.terms-hero h1 {
  position: relative;
  margin: 14px 0 20px;
  font-family: var(--display);
  font-size: clamp(4rem, 8vw, 7.5rem);
  font-weight: 800;
  letter-spacing: -0.075em;
  line-height: 0.84;
}

.terms-hero h1 em {
  color: var(--orange);
  font-style: normal;
}

.terms-hero > p {
  position: relative;
  max-width: 640px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1rem;
  line-height: 1.75;
}

.terms-meta {
  position: absolute;
  right: clamp(24px, 8vw, 130px);
  bottom: 48px;
  display: flex;
  gap: 25px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.terms-meta span:first-child {
  color: var(--green);
}

.terms-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 790px);
  max-width: 1160px;
  gap: clamp(50px, 8vw, 110px);
  margin: 0 auto;
  padding: 100px 28px 120px;
}

.terms-nav {
  position: sticky;
  top: 30px;
  align-self: start;
  display: grid;
  gap: 0;
}

.terms-nav > strong {
  margin-bottom: 18px;
  color: var(--navy);
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.terms-nav > a {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.terms-nav > a:hover {
  color: var(--pink);
  padding-left: 5px;
}

.terms-content {
  display: grid;
}

.terms-content section {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 24px;
  padding: 0 0 48px;
  scroll-margin-top: 30px;
}

.terms-content section + section {
  padding-top: 48px;
  border-top: 1px solid var(--line);
}

.terms-content section > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: var(--navy);
  background: rgba(34, 63, 107, 0.07);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 800;
}

.terms-content h2 {
  margin: 3px 0 14px;
  color: var(--navy);
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  letter-spacing: -0.035em;
}

.terms-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.85;
}

.terms-content p a {
  color: var(--pink);
  font-weight: 700;
}

.terms-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 35px clamp(24px, 6vw, 90px);
  color: rgba(255, 255, 255, 0.56);
  background: var(--navy-deep);
  font-size: 0.74rem;
}

.terms-footer a {
  color: var(--paper);
  font-weight: 700;
}

.terms-footer a span {
  margin-left: 8px;
  color: var(--orange);
}

@keyframes imageArrival {
  from { opacity: 0; scale: 1.08; }
  to { opacity: 1; scale: 1; }
}

@keyframes copyArrival {
  from { opacity: 0; transform: translateY(35px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardArrival {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes noteArrival {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes panelArrival {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 9px rgba(79, 187, 55, 0.04); }
}

@keyframes shapeFloat {
  50% { translate: 0 -16px; rotate: 12deg; }
}

@keyframes orbFloat {
  50% { translate: 0 -25px; scale: 1.05; }
}

@keyframes successPop {
  0% { opacity: 0; transform: scale(0.65) rotate(-10deg); }
  70% { transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes shake {
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

@media (max-width: 1180px) {
  .auth-shell {
    grid-template-columns: 42% 1fr;
  }

  .note-two {
    display: none;
  }

  .visual-copy {
    top: 112px;
    bottom: 190px;
  }
}

@media (max-width: 900px) {
  /*
   * A column the height of the screen: the form takes the room it needs and the
   * photograph fills the rest, so no screen is left with a pool of empty ground
   * under the card, whatever the phone or tablet.
   */
  .auth-shell {
    display: flex;
    flex-direction: column;
  }

  /*
   * The photograph is not a desktop luxury: on a phone it becomes a band across
   * the top, carrying the wordmark and the headline over the same scrim, and the
   * form card lifts onto its lower edge. Hidden, the phone was left with a bare
   * form on a flat ground and no wordmark at all.
   */
  /*
   * Only the wordmark rides on the photograph, so the band is short. Everything
   * on this screen is sized to land inside one phone height: the whole point of
   * a login is the two fields and the button, and a reader should not have to
   * scroll to reach them.
   */
  .auth-visual {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /*
     * The photograph grows into whatever height the form leaves, measured from
     * the form itself rather than a guess at its size, so a heading that wraps on
     * a narrow phone cannot push the card up over the wordmark. The floor keeps
     * the wordmark clear of the card and the faces in view on the smallest
     * phones (the page scrolls there instead); the ceiling stops a tall tablet
     * from turning the screen into one photograph.
     */
    flex: 1 0 auto;
    min-height: 168px;
    max-height: 56svh;
    /*
     * The public header changes size at 580px, so this follows it in two tiers.
     * Above 580 its bar is 88px with 16px of padding and a 34px wordmark centred
     * in the 56px row between - top edge 27px down. The narrow tier is below.
     * The 44px foot clears the form card, which laps 30px over the photograph.
     */
    padding: 27px clamp(24px, 4.5vw, 72px) 44px;
  }

  /* The greeting is in the card below; up here it was said twice. */
  .visual-copy,
  .visual-note,
  .shape {
    display: none;
  }

  /* Larger than the public header's 34px: this band has the room for it. */
  .auth-brand-logo {
    height: 40px;
  }

  /* The faces sit high in the photograph; a short band keeps them in view. */
  .auth-visual > img,
  html[dir="rtl"] .auth-visual > img {
    object-position: 50% 30%;
  }

  .auth-main {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    min-height: 0;
    width: 100%;
    max-width: 560px;
    margin-inline: auto;
    /* Lifts the card onto the foot of the photograph. */
    margin-top: -30px;
    padding: 0 18px 20px;
    background: none;
  }

  .auth-card {
    padding: 20px 18px 18px;
    border-radius: 24px;
    background: var(--paper);
    box-shadow: 0 24px 60px rgba(14, 34, 60, 0.16);
  }

  /* The strapline only restated the heading above it. */
  .auth-heading p {
    display: none;
  }

  .auth-heading {
    margin-bottom: 14px;
  }

  .auth-form {
    gap: 18px;
  }

  .field {
    gap: 12px;
  }

  .auth-actions {
    gap: 16px;
  }

  /*
   * Only the code is drawn, as on the public site. The long label stays in the
   * markup for the script to write into.
   */
  .auth-language i,
  .auth-language [data-language-label] {
    display: none;
  }

  .input-wrap input {
    height: 50px;
  }

  .legal-copy {
    margin-top: 14px;
  }

  .auth-support {
    margin-top: 10px;
  }

  /* Floats over the photograph rather than over the form. */
  .auth-language {
    position: fixed;
    top: 30px;
    inset-inline-end: 16px;
    z-index: 5;
    color: var(--paper);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
  }

  .auth-topbar {
    top: 24px;
    right: 25px;
    left: 25px;
    justify-content: space-between;
  }

  .brand-mobile {
    display: inline-flex;
  }

  .terms-layout {
    grid-template-columns: 1fr;
    gap: 55px;
  }

  .terms-nav {
    position: static;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 25px;
  }

  .terms-nav > strong {
    grid-column: 1 / -1;
  }

  .terms-meta {
    position: relative;
    right: auto;
    bottom: auto;
    margin-top: 35px;
  }
}

@media (max-width: 620px) {
  .auth-main {
    align-content: start;
    padding: 0 14px 20px;
  }

  .auth-topbar {
    right: 18px;
    left: 18px;
  }

  /*
   * The "On this page" jump list is a desktop convenience: on a phone the whole
   * document is one short scroll and the links only push the reading down.
   */
  .terms-nav > strong,
  .terms-nav > a {
    display: none;
  }

  .terms-layout {
    gap: 30px;
  }

  .terms-brand img {
    height: 40px;
  }

  .brand-mobile .brand-mark,
  .simple-auth-header .brand-mark,
  .terms-header .brand-mark {
    width: 43px;
    height: 43px;
    border-radius: 13px;
  }

  .brand-mobile strong,
  .simple-auth-header strong,
  .terms-header strong {
    font-size: 0.9rem;
  }

  .brand-mobile small,
  .simple-auth-header small,
  .terms-header small {
    font-size: 0.54rem;
  }

  .auth-topbar .back-link {
    font-size: 0;
  }

  .auth-topbar .back-link svg {
    width: 22px;
  }

  .auth-card {
    margin-top: 0;
  }

  .auth-heading {
    margin-bottom: 14px;
  }

  .form-options {
    align-items: flex-start;
  }

  .simple-auth-header {
    padding: 20px 18px;
  }

  .simple-auth-header .back-link {
    font-size: 0.74rem;
  }

  .recovery-main {
    min-height: calc(100svh - 84px);
    padding: 18px 12px 35px;
  }

  .recovery-card {
    min-height: 630px;
    padding: 38px 20px 35px;
    border-radius: 23px;
  }

  .recovery-progress {
    margin: 20px 8px 36px;
  }

  .code-grid {
    gap: 4px;
  }

  .code-grid input {
    height: 48px;
    border-radius: 9px;
    font-size: 1.05rem;
  }

  .recovery-footer {
    flex-wrap: wrap;
    justify-content: center;
  }

  .terms-header {
    min-height: 68px;
    padding: 12px 16px;
  }

  .terms-header .back-link {
    display: none;
  }

  .terms-header > div {
    gap: 10px;
  }

  .terms-login {
    padding: 10px 17px;
  }

  .terms-hero {
    min-height: 470px;
    padding: 80px 22px 65px;
  }

  .terms-hero h1 {
    font-size: clamp(3.5rem, 18vw, 5.5rem);
  }

  .terms-meta {
    display: grid;
    gap: 9px;
  }

  .terms-layout {
    padding: 70px 20px 85px;
  }

  .terms-nav {
    grid-template-columns: 1fr;
  }

  .terms-nav > strong {
    grid-column: auto;
  }

  .terms-content section {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .terms-content section > span {
    width: 38px;
    height: 38px;
  }

  .terms-footer {
    display: grid;
    gap: 15px;
  }
}

/*
 * A taller phone leaves the photograph enough room to say something under the
 * wordmark. Kept to a height query rather than a width one: the band is sized
 * from what is left after the form, so it is the height of the screen that
 * decides whether there is space, not how wide it is. Two lines of a 2.6rem
 * headline plus its supporting line need about 126px, which a screen shorter
 * than 760px cannot spare - below that the wordmark has the band to itself.
 */
@media (max-width: 900px) and (min-height: 760px) {
  .auth-visual {
    justify-content: space-between;
    /* Deeper foot than the 44px that merely clears the card, so the words sit
       up in the photograph rather than against the edge of the form. */
    padding-bottom: 60px;
  }

  .visual-copy {
    display: block;
    position: static;
    max-width: none;
    margin: 0;
    padding-right: 0;
  }

  .visual-copy h1 {
    margin: 0 0 8px;
    font-size: clamp(1.9rem, 8.5vw, 2.6rem);
    line-height: 1.12;
  }

  /* Wider measure keeps the supporting line to two rows at this size. */
  .visual-copy p {
    display: block;
    max-width: 40ch;
    font-size: 0.84rem;
    line-height: 1.45;
  }

  /* The eyebrow was asked for earlier; the headline carries the line now. */
  .mini-label {
    display: none;
  }
}

/*
 * Short phones (an iPhone SE, a small Android) cannot fit the photograph and the
 * whole form in one screen. The form steps down a size so the scroll is short,
 * and the button stays within reach.
 */
@media (max-width: 900px) and (max-height: 700px) {
  .auth-heading h2 {
    margin: 6px 0 10px;
    font-size: clamp(1.6rem, 7.5vw, 2rem);
  }

  .auth-heading {
    margin-bottom: 10px;
  }

  .auth-form {
    gap: 14px;
  }

  .field {
    gap: 8px;
  }

  .input-wrap input {
    height: 46px;
  }

  .auth-actions {
    gap: 12px;
  }
}

/*
 * The narrow tier of the public header: at 580px its bar grows to 92px with
 * 30px above and 12px below, and the wordmark drops to 22px - top edge 44px
 * down, hard against a 16px margin. The login photograph follows it.
 */
@media (max-width: 580px) {
  .auth-visual {
    padding-top: 44px;
    padding-inline: 16px;
  }

  .auth-brand-logo {
    height: 40px;
  }
}

/*
 * Short screens - a 1366x768 laptop leaves roughly 600px of page once the browser
 * takes its share. Everything shrinks by a step so the card still fits without
 * scrolling and the headline keeps clear of the logo above it.
 */
@media (min-width: 901px) and (max-height: 820px) {
  .auth-main {
    padding-top: 28px;
    padding-bottom: 26px;
  }

  .auth-heading {
    margin-bottom: 18px;
  }

  .auth-heading h2,
  .recovery-panel h1 {
    margin: 6px 0 10px;
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  }

  .auth-heading p {
    font-size: 0.88rem;
  }

  .auth-form {
    gap: 15px;
  }

  .input-wrap input {
    height: 48px;
  }

  .legal-copy {
    margin-top: 16px;
  }

  .auth-support {
    margin-top: 12px;
  }

  /* The photo side loses the same amount, in the same proportions. */
  .auth-visual {
    padding-block: 26px;
  }

  .auth-brand-logo {
    height: 42px;
  }

  .visual-copy {
    top: 92px;
    bottom: 152px;
  }

  .visual-copy h1 {
    font-size: clamp(2.4rem, 3.4vw, 3.6rem);
  }

  .visual-copy p {
    font-size: 0.92rem;
  }

  .visual-note {
    bottom: 78px;
    padding: 10px 13px;
  }
}

/* Shorter still: the two floating cards are the first thing that can go. */
@media (min-width: 901px) and (max-height: 660px) {
  .visual-note {
    display: none;
  }

  .visual-copy {
    top: 84px;
    bottom: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Language controls and Arabic layout */
.language-switch {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.language-switch:hover {
  border-color: rgba(34, 63, 107, 0.28);
  background: var(--paper);
  transform: translateY(-2px);
}

.language-switch i {
  width: 1px;
  height: 14px;
  background: currentColor;
  opacity: 0.24;
}

.language-switch-dark {
  color: var(--paper);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.language-switch-dark:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
}

.auth-top-actions,
.simple-header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

html[dir="rtl"] body {
  font-family: var(--body);
  text-align: right;
}

html[dir="rtl"] .auth-brand strong,
html[dir="rtl"] .auth-brand small,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .visual-note strong,
html[dir="rtl"] .primary-auth-button,
html[dir="rtl"] .terms-nav > strong {
  font-family: var(--display);
}

html[dir="rtl"] .auth-brand small,
html[dir="rtl"] .section-kicker,
html[dir="rtl"] .mini-label,
html[dir="rtl"] .terms-meta,
html[dir="rtl"] .terms-nav > strong {
  letter-spacing: 0;
}

html[dir="rtl"] .auth-visual > img {
  object-position: 42% center;
}

html[dir="rtl"] .visual-wash {
  background:
    linear-gradient(180deg, rgba(8, 22, 42, 0.4), rgba(8, 22, 42, 0.94)),
    linear-gradient(270deg, rgba(8, 22, 42, 0.72), transparent 70%);
}

html[dir="rtl"] .visual-copy {
  right: clamp(30px, 4vw, 68px);
  left: auto;
  padding-right: 0;
  padding-left: 45px;
}

html[dir="rtl"] .note-one {
  right: clamp(30px, 4vw, 68px);
  left: auto;
}

html[dir="rtl"] .note-two {
  right: auto;
  left: clamp(30px, 4vw, 68px);
}

html[dir="rtl"] .auth-topbar {
  direction: rtl;
}

html[dir="rtl"] .back-link:hover {
  transform: translateX(3px);
}

html[dir="rtl"] .back-link svg,
html[dir="rtl"] .primary-auth-button > svg,
html[dir="rtl"] .terms-footer a span {
  transform: scaleX(-1);
}

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

html[dir="rtl"] input[type="email"],
html[dir="rtl"] .code-grid,
html[dir="rtl"] #recovery-email-label {
  direction: ltr;
}

/*
 * The address is Latin, so it keeps its left-to-right run - but it belongs beside
 * the envelope on the right, not stranded at the far edge of the field.
 */
html[dir="rtl"] input[type="email"] {
  text-align: right;
}

html[dir="rtl"] .compact-form,
html[dir="rtl"] .field-message {
  text-align: right;
}

html[dir="rtl"] .recovery-card::after {
  right: auto;
  left: -70px;
}

html[dir="rtl"] .terms-orbit {
  right: auto;
  left: -120px;
}

html[dir="rtl"] .terms-meta {
  right: auto;
  left: clamp(24px, 8vw, 130px);
}

html[dir="rtl"] .terms-nav > a:hover {
  padding-right: 5px;
  padding-left: 0;
}

html[dir="rtl"] .terms-footer a span {
  display: inline-block;
  margin-right: 8px;
  margin-left: 0;
}

@media (max-width: 900px) {
  html[dir="rtl"] .terms-meta {
    right: auto;
    left: auto;
  }
}

@media (max-width: 620px) {
  .auth-top-actions {
    gap: 9px;
  }

  .auth-top-actions .language-switch {
    min-height: 37px;
    padding: 0 10px;
  }

  .simple-header-actions {
    gap: 10px;
  }

  .simple-header-actions .language-switch {
    min-height: 36px;
    padding: 0 10px;
  }

  .terms-header > div {
    gap: 8px;
  }

  .terms-header .language-switch {
    min-height: 37px;
    padding: 0 10px;
  }

}
