/* وصّلهالي on the web: the apps' tokens (DESIGN.md, packages/shared/src/theme.ts). */
:root {
  --navy: #0a1330;
  --navy-700: #22305c;
  --navy-disabled: #a7aec2;
  --ink: #0a1330;
  --muted: #5a6480;
  --surface: #ffffff;
  --canvas: #f4f6fb;
  --line: #dde2ee;
  --error: #c62e2e;
  --error-soft: #fbeaea;
  --radius: 16px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Readex Pro", "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 26px;
}

::selection {
  background: #fff3d1;
  color: var(--navy);
}

.page {
  max-width: 480px;
  margin-inline: auto;
  padding: 48px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mark {
  display: block;
  width: 40px;
  height: 45px;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 38px;
  font-weight: 700;
}

h1:focus {
  outline: none;
}

.body {
  margin: 0;
  color: var(--muted);
}

.body:empty {
  display: none;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.step[hidden],
.message[hidden] {
  display: none;
}

.label {
  font-weight: 600;
  margin-bottom: -12px;
}

.field {
  width: 100%;
  height: 60px;
  padding-inline: 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 22px;
  line-height: 32px;
  font-weight: 600;
  text-align: start;
  caret-color: var(--navy);
}

.field.code {
  height: 68px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
}

.field:focus {
  outline: none;
  border-color: var(--navy);
}

.field[aria-invalid="true"] {
  border-color: var(--error);
}

.field:disabled {
  background: var(--canvas);
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding-inline: 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--surface);
  font: inherit;
  font-weight: 600;
  line-height: 24px;
  cursor: pointer;
}

.primary:hover,
.primary:active,
.primary[aria-busy="true"] {
  background: var(--navy-700);
}

.primary:disabled:not([aria-busy="true"]) {
  background: var(--navy-disabled);
  cursor: default;
}

.primary[aria-busy="true"]::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid rgb(255 255 255 / 0.35);
  border-top-color: var(--surface);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.text {
  align-self: center;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--navy-700);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.text:disabled {
  opacity: 0.6;
  cursor: default;
}

.primary:focus-visible,
.text:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.message {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--error-soft);
  color: var(--error);
  font-size: 13px;
  line-height: 20px;
}

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

@media (prefers-reduced-motion: reduce) {
  .primary[aria-busy="true"]::before {
    animation-duration: 2.4s;
  }
}

/* Reading pages (privacy policy, landing). */
.doc {
  max-width: 680px;
}

.doc h2 {
  margin: 24px 0 8px;
  font-size: 20px;
  line-height: 30px;
  font-weight: 600;
}

.doc p,
.doc ul {
  margin: 0 0 12px;
}

.doc ul {
  padding-inline-start: 24px;
}

.doc li + li {
  margin-top: 4px;
}

.doc-en {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

a {
  color: var(--navy-700);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
  border-radius: 4px;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.links a {
  padding-block: 8px;
}
