/* Auth pages: register, verify codes, login. One narrow column, calm and thumb-friendly. */
@layer page {
  .auth {
    padding-block: var(--space-8) var(--space-16);
  }

  .auth__panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    max-inline-size: 440px;
    margin-inline: auto;
    padding: var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
  }

  @media (min-width: 768px) {
    .auth {
      padding-block: var(--space-16) var(--space-24);
    }

    .auth__panel {
      padding: var(--space-8);
    }
  }

  .auth__head h1 {
    font-size: var(--text-h3);
    line-height: var(--leading-tight);
  }

  .auth__head p {
    margin-block-start: var(--space-2);
    color: var(--color-text-secondary);
    font-size: var(--text-15);
    line-height: var(--leading-body);
  }

  .auth__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-block-start: var(--space-1);
  }

  .auth__note,
  .auth__foot {
    color: var(--color-text-secondary);
    font-size: var(--text-14);
    line-height: var(--leading-snug);
    text-align: center;
  }

  .auth__link {
    align-self: flex-start;
    font-size: var(--text-14);
  }

  /* ─── Login method switch (links, works without JS) ─── */
  .auth-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-1);
    padding: var(--space-1);
    border-radius: var(--radius-md);
    background: var(--color-surface-alt);
  }

  .auth-switch__item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-block-size: var(--control-md);
    border-radius: var(--radius-sm);
    color: var(--color-text-strong-muted);
    font-size: var(--text-14);
    font-weight: var(--weight-semibold);
    text-decoration: none;
    transition: background-color var(--duration-micro) var(--ease-out);
  }

  .auth-switch__item[aria-current="page"] {
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: var(--shadow-xs);
  }

  /* ─── Code target (phone / email the code went to) ─── */
  .auth-target {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    padding-block: var(--space-3);
    padding-inline: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-surface);
  }

  .auth-target__value {
    min-inline-size: 0;
    font-weight: var(--weight-semibold);
    overflow-wrap: anywhere;
  }

  .auth-target__edit {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-block-size: var(--control-md);
    font-size: var(--text-14);
  }

  /* ─── 6-digit code input ─── */
  .field .code-input {
    direction: ltr;
    text-align: center;
    font-size: var(--text-20);
    font-weight: var(--weight-semibold);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.35em; /* digits only (Latin) — never on Persian text */
    min-block-size: var(--control-lg);
  }

  /* ─── Password visibility toggle (added by auth.js) ─── */
  .password-input {
    position: relative;
  }

  .field .password-input input {
    padding-inline-end: var(--space-12);
  }

  .password-input__toggle {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    margin-block: auto;
    color: var(--color-text-secondary);
  }
}
