/*
 * The sign-in and account pages (app/views/sessions, registrations, passwords,
 * accounts), following Figma A1 to A9. Mobile screens use 24 at the sides;
 * desktop screens put the same column, 440 wide, under the header. The colours
 * are set in legal.css. Logical properties serve Arabic and English alike.
 */

.auth {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-inline-size: 440px;
  margin-inline: auto;
  padding-block: 64px;
  font-size: 16px;
  line-height: 26px;
}

.auth > *,
.auth-form > *,
.auth p {
  margin: 0;
}

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

.auth h1 {                    /* Title */
  font-size: 24px;
  line-height: 36px;
  color: var(--ink);
}

.auth .lead {                 /* Body */
  color: var(--muted);
}

.auth .help,
.auth .note {                 /* Small */
  font-size: 14px;
  line-height: 22px;
  color: var(--muted);
}

.auth .note {
  text-align: center;
}

.auth .note a {
  color: var(--ink);
}

/* Back arrow: 44 square, pointing to the start of the line. */
.back {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 44px;
  block-size: 44px;
  margin-inline-start: -10px;
}

.back svg,
.badge svg,
.chevron {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back svg {
  inline-size: 44px;
  block-size: 44px;
}

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

/* Field: label above a white box, 8 apart. */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.field input {
  block-size: 52px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 26px;
}

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

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

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

.field-error {
  font-size: 14px;
  line-height: 22px;
  color: var(--danger);
}

/* Buttons: 52 high, radius 12. Primary is dark, secondary outlined, text plain. */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 100%;
  min-block-size: 52px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--ink);
  color: var(--surface);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
}

/* Between the email form and Apple and Google: "or", with a line each side. */
.auth .divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 22px;
  color: var(--muted);
}

.auth .divider::before,
.auth .divider::after {
  content: "";
  flex: 1;
  border-block-start: 1px solid var(--line);
}

.auth :focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* A2: the error box, red outline. */
.alert {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--danger);
  border-radius: 16px;
  background: var(--surface);
}

.alert-title {
  font-weight: 500;
  color: var(--danger);
}

.auth .box {
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
}

/* A4: the round tick. */
.badge {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 56px;
  block-size: 56px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.badge svg {
  inline-size: 24px;
  block-size: 24px;
}

/* A9: grouped rows, 1 apart on the line colour so the gaps read as dividers. */
.auth .group-label {
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  color: var(--muted);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--line);
  list-style: none;
}

.list li,
.list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-block-size: 58px;
  padding: 16px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.list li:has(> a) {
  padding: 0;
}

.list a {
  flex: 1;
}

.list-title {
  flex: 1;
}

.list-value {
  font-size: 14px;
  line-height: 22px;
  color: var(--muted);
}

.chevron {
  flex: none;
  inline-size: 24px;
  block-size: 24px;
  stroke: var(--muted);
}

/* Phones: the Figma mobile screens use 24 at the sides. */
@media (max-width: 688px) {
  .auth {
    padding-block: 32px;
    padding-inline: 24px;
  }
}
