/* Cairo, served from this origin (the page's policy allows nothing else): the
   same typeface as the application the page opens. SIL Open Font License,
   fonts/OFL.txt. */
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/cairo-arabic.woff2') format('woff2');
  unicode-range:
    U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E,
    U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/cairo-latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --brand: #284898;
  --brand-deep: #1b3170;
  --brand-night: #111f4d;
  --accent: #0a9b8f;
  --ink: #18213a;
  --quiet: #5b6784;
  --line: #d5dcea;
  --field: #f5f7fb;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --surface: #ffffff;
  --page: #eef2f9;
  --on-brand: #ffffff;
  --shadow-sheet: 0 -18px 50px -24px rgb(17 31 77 / 45%);
  --shadow-mark: 0 18px 40px -16px rgb(0 0 0 / 55%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ecf6;
    --quiet: #a3aec6;
    --line: #2f3a57;
    --field: #141c31;
    --danger: #ff8a80;
    --danger-bg: rgb(255 138 128 / 12%);
    --surface: #0f1628;
    --page: #0a1020;
    --shadow-sheet: 0 -18px 50px -24px rgb(0 0 0 / 70%);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Cairo', system-ui, 'Segoe UI', Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

/* --- the company page ------------------------------------------------------ */

/* The whole screen is the brand's ground, with a faint field of dots and two
   lights, and the form is a card of frosted glass in the middle: the same
   shape as the companies' own sign-in screen, which this page hands over to. */
body.launch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 16px 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle, rgb(255 255 255 / 11%) 1px, transparent 1.5px) 0 0 / 22px 22px,
    radial-gradient(70% 42% at 88% 0%, rgb(10 160 160 / 42%), transparent 72%),
    radial-gradient(75% 45% at 0% 52%, rgb(61 107 224 / 34%), transparent 72%),
    radial-gradient(80% 38% at 100% 100%, rgb(10 160 160 / 20%), transparent 72%),
    linear-gradient(165deg, #1e356f 0%, #14254f 45%, #0b1430 100%);
  background-attachment: fixed;
}

/* A light that drifts slowly across the top. */
body.launch::before {
  position: fixed;
  top: -5rem;
  inset-inline-start: -4rem;
  z-index: -1;
  width: 22rem;
  height: 22rem;
  content: '';
  background: radial-gradient(closest-side, rgb(10 160 160 / 38%), transparent);
  border-radius: 50%;
  pointer-events: none;
  animation: drift 16s ease-in-out infinite alternate;
}

.hero {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0 8px 22px;
  color: var(--on-brand);
  text-align: center;
}

.hero-mark {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  margin-bottom: 14px;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 30px;
  background: rgb(255 255 255 / 10%);
  box-shadow:
    0 0 0 7px rgb(255 255 255 / 6%),
    0 0 60px -4px rgb(10 160 160 / 70%),
    var(--shadow-mark);
  animation: rise 700ms var(--ease) both;
}

.logo {
  display: block;
  border-radius: 22px;
}

.wordmark {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  text-shadow: 0 2px 18px rgb(0 0 0 / 30%);
  animation: rise 700ms 80ms var(--ease) both;
}

.tagline {
  max-width: 22rem;
  margin: 0;
  color: rgb(255 255 255 / 82%);
  font-size: 0.95rem;
  animation: rise 700ms 140ms var(--ease) both;
}

.sheet {
  width: min(100%, 27rem);
  padding: 26px 20px 22px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 12%),
    0 40px 80px -32px rgb(0 0 0 / 70%),
    0 10px 24px -14px rgb(0 0 0 / 40%);
  backdrop-filter: blur(22px) saturate(150%);
  animation: sheet-in 600ms 120ms var(--ease) both;
}

.sheet[hidden] {
  display: none;
}

.sheet h1 {
  margin: 0 0 4px;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.35;
}

.lead {
  margin: 0 0 22px;
  color: var(--quiet);
  font-size: 0.97rem;
}

form {
  display: grid;
  gap: 8px;
}

label {
  font-size: 0.95rem;
  font-weight: 700;
}

.field {
  position: relative;
}

.field-icon {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 16px;
  width: 22px;
  height: 22px;
  margin-block: auto;
  color: var(--quiet);
  pointer-events: none;
}

input {
  width: 100%;
  min-height: 58px;
  padding: 12px 18px 12px 50px;
  color: var(--ink);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0.02em;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--field);
  transition:
    border-color 160ms var(--ease),
    box-shadow 160ms var(--ease),
    background-color 160ms var(--ease);
}

input::placeholder {
  color: var(--quiet);
  font-weight: 500;
  opacity: 0.75;
}

/* Empty, the field reads in Arabic, from the right; the code itself is typed
   in Latin letters, from the left. */
input:placeholder-shown {
  font-size: 1rem;
  text-align: right;
  direction: rtl;
  letter-spacing: 0;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgb(10 155 143 / 18%);
}

input[aria-invalid='true'] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgb(179 38 30 / 12%);
}

.error {
  margin: 0;
  color: var(--danger);
  font-size: 0.93rem;
  font-weight: 600;
}

.error:not(:empty) {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--danger-bg);
}

button {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin-top: 6px;
  color: var(--on-brand);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  box-shadow: 0 14px 28px -14px rgb(27 49 112 / 70%);
  cursor: pointer;
  transition:
    transform 160ms var(--ease),
    box-shadow 160ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: scale(0.98);
}

button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.button-icon {
  width: 20px;
  height: 20px;
}

.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgb(255 255 255 / 35%);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

button.is-busy .button-icon {
  display: none;
}

button.is-busy .spinner {
  display: block;
}

button:disabled {
  cursor: progress;
}

.hint {
  margin: 18px 0 0;
  color: var(--quiet);
  font-size: 0.88rem;
  text-align: center;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 18px 16px max(14px, env(safe-area-inset-bottom));
  color: rgb(255 255 255 / 75%);
  font-size: 0.8rem;
}

.foot a {
  color: rgb(255 255 255 / 88%);
}

@media (min-width: 40rem) {
  .sheet {
    padding: 32px 30px;
  }
}

/* The code was right: the card steps back, the mark glows, the chime plays,
   and the company's own screen follows. */
body.is-opening .sheet,
body.is-opening .foot,
body.is-opening .tagline {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity 420ms var(--ease),
    transform 420ms var(--ease);
}

body.is-opening .hero-mark {
  transform: translateY(18vh) scale(1.18);
  box-shadow:
    0 0 0 10px rgb(255 255 255 / 8%),
    0 0 90px 4px rgb(10 160 160 / 75%),
    var(--shadow-mark);
  transition:
    transform 700ms var(--ease),
    box-shadow 700ms var(--ease);
}

body.is-opening .wordmark {
  transform: translateY(18vh);
  transition: transform 700ms var(--ease);
}

/* A short phone: the line under the name gives way to the form. */
@media (max-height: 640px) {
  .tagline {
    display: none;
  }

  .hero-mark {
    width: 84px;
    height: 84px;
    margin-bottom: 6px;
  }

  .hero-mark .logo {
    width: 64px;
    height: 64px;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
}

@keyframes drift {
  to {
    transform: translate(-4rem, 3rem) scale(1.25);
  }
}

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

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

/* --- the privacy policy (privacy.html): a readable document ------------------ */

body.document {
  display: block;
  padding: 24px 16px 48px;
}

.policy {
  max-width: 44rem;
  margin: 0 auto;
  padding: 28px 24px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
}

.policy header {
  margin-bottom: 8px;
  text-align: center;
}

.policy .logo {
  margin: 0 auto 8px;
}

.policy h1 {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 1.5rem;
}

.policy h2 {
  margin: 28px 0 8px;
  color: var(--brand);
  font-size: 1.15rem;
}

.policy .meta {
  margin: 0;
  color: var(--quiet);
  font-size: 0.95rem;
}

.policy ul {
  padding-inline-start: 1.25rem;
}

.policy li {
  margin-bottom: 8px;
}

.policy a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.policy hr {
  margin: 36px 0 8px;
  border: 0;
  border-top: 1px solid var(--line);
}

.policy .english {
  font-family: system-ui, 'Segoe UI', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  .policy h1,
  .policy h2 {
    color: #93acf2;
  }
}
