/*
 * Sign-in and registration (Figma page «13 Account»): a compact header, one card of 440 on the
 * canvas, the legal links under it. On phones the card is the screen: no border, no corners.
 */
.lq-auth {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-bg-canvas);
}

/* What the script shows and hides: a class that lays a block out must not bring it back. */
.lq-auth [hidden] {
  display: none;
}

.lq-auth__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding-inline: 96px;
  background: var(--color-bg-surface);
  border-block-end: 1px solid var(--color-border-default);
}

.lq-auth__switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lq-auth__prompt {
  color: var(--color-text-secondary);
  font: 400 14px / 24px var(--font-ui);
  white-space: nowrap;
}

.lq-auth__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 64px 16px;
}

.lq-auth__main:focus-visible {
  box-shadow: none;
}

.lq-auth__card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 440px;
  padding: 32px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
}

.lq-auth__heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lq-auth__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.lq-auth__title {
  font: 700 28px / 42px var(--font-heading);
}

.lq-auth__lede {
  color: var(--color-text-secondary);
  font: 400 16px / 28px var(--font-ui);
}

.lq-auth__form,
.lq-auth__fields,
.lq-auth__actions {
  display: flex;
  flex-direction: column;
}

.lq-auth__form {
  gap: 24px;
}

.lq-auth__fields,
.lq-auth__actions {
  gap: 16px;
}

/* Cloudflare's box (300×65) at the start of the form, its place kept while it loads. */
.lq-auth__turnstile {
  align-self: flex-start;
  min-width: 300px;
  max-width: 100%;
  min-height: 65px;
}

.lq-auth__alt {
  color: var(--color-text-secondary);
  font: 400 14px / 24px var(--font-ui);
}

/* «نسيت كلمة المرور؟» under the password, at its far end (plan 12 stage 8, G, D12.199). */
.lq-auth__forgot {
  margin-block-start: -8px;
  font: 500 14px / 20px var(--font-ui);
  text-align: end;
}

.lq-auth__forgot a {
  display: inline-block;
  padding-block: 4px;
  color: var(--color-text-primary);
  text-underline-offset: 3px;
}

@media (max-width: 767px) {
  .lq-auth__forgot a {
    padding-block: 12px;
  }
}

.lq-auth__alt a {
  color: var(--color-text-primary);
  font-weight: 500;
  text-underline-offset: 3px;
}

.lq-auth__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 24px;
}

.lq-auth__legal a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--color-text-muted);
  font: 400 12px / 18px var(--font-ui);
  text-decoration: none;
}

.lq-auth__legal a:hover {
  color: var(--color-text-primary);
  text-decoration: underline;
}

/*
 * Sign in with Apple (plan 17): Apple's guidelines allow its button black, white or outlined, in
 * those exact colours, so they are written here rather than taken from the theme. Black on the
 * light card, white on the dark one; the focus ring is the kit's, like every control.
 */
.lq-btn--apple {
  background: #000;
  color: var(--white);
}

.lq-btn--apple:hover {
  background: color-mix(in srgb, #000 82%, white);
}

:root[data-theme="dark"] .lq-btn--apple {
  background: var(--white);
  color: #000;
}

:root[data-theme="dark"] .lq-btn--apple:hover {
  background: color-mix(in srgb, var(--white) 88%, black);
}

/* «أو» with a line on either side, filling the card's width. */
.lq-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-muted);
  font: 400 14px / 24px var(--font-ui);
}

.lq-or::before,
.lq-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border-default);
}

@media (max-width: 1279px) {
  .lq-auth__header {
    padding-inline: 32px;
  }
}

@media (max-width: 767px) {
  .lq-auth {
    background: var(--color-bg-surface);
  }

  .lq-auth__header {
    min-height: 52px;
    padding: 4px 16px;
  }

  .lq-auth__switch {
    gap: 4px;
  }

  .lq-auth__switch .lq-btn {
    padding-inline: 12px;
  }

  /* The logo is a way home: a target of 44, like every other on phones. */
  .lq-auth__header .lq-brand {
    min-height: var(--target-min);
  }

  .lq-auth__main {
    gap: 0;
    padding: 0;
  }

  /* The card is the screen. */
  .lq-auth__card {
    flex: 1;
    max-width: none;
    padding: 32px 16px 24px;
    border: 0;
    border-radius: 0;
  }

  /* The switch line is a row of 44, and its link a target of 44. */
  .lq-auth__alt a {
    display: inline-block;
    padding-block: 10px;
  }

  .lq-auth__legal {
    gap: 0 16px;
    padding: 0 16px 24px;
  }

  .lq-auth__legal a {
    min-height: var(--target-min);
  }
}

/*
 * On one line beside the logo and the button, the question needs a screen of 376px (measured in
 * Chromium with the kit's fonts); on a narrower phone it would push the page sideways (WCAG
 * 1.4.10). Below 390 it goes: the button says where it leads, and the question is asked again
 * under the card. From 390, a phone whose fonts run wider wraps it rather than scroll.
 */
@media (max-width: 767px) {
  .lq-auth__prompt {
    white-space: normal;
  }
}

@media (max-width: 389px) {
  .lq-auth__prompt {
    display: none;
  }
}
