/* ==========================================================================
   Auth surface (css/surfaces/auth.css): login, registration, password reset,
   password change, verification, referral landing.
   Minimal chrome: the shared glass bar with logo and one quiet link, a
   legal line at the bottom. One glass card with the form; on >= 1024 the
   registration and referral screens get a quiet text column next to it.
   ========================================================================== */

.page-auth {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  margin: 0;
  background: var(--sky), var(--color-canvas);
  background-repeat: no-repeat;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  overflow-x: clip;
}

/* Main */
.auth {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  width: 100%;
  padding: clamp(32px, 9vh, 104px) 16px var(--space-10);
}

.auth-layout {
  width: 100%;
  max-width: 452px;
  margin-inline: auto;
}

/* login/script.js shows its field hints in .info (display set inline),
   under the button so the button never moves while a field loses focus */
.auth-card .info:empty {
  display: none;
}

.auth-card .auth-hint {
  margin: var(--space-4) 0 0;
}

/* Card: one calm glass plate */
.auth-card {
  position: relative;
  box-sizing: border-box;
  padding: var(--space-10) var(--space-10) var(--space-8);
  border-radius: var(--radius-xl);
  background: var(--glass-plate);
  -webkit-backdrop-filter: var(--glass-blur-plate);
  backdrop-filter: var(--glass-blur-plate);
  box-shadow: inset 0 1px 0 var(--color-surface), var(--shadow-card);
  animation: auth-in 0.55s var(--ease-out-expo) both;
}

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

@media (prefers-reduced-motion: reduce) {
  .auth-card {
    animation: none;
  }
}

.auth-head {
  margin: 0 0 var(--space-6);
}

/* login/script.js focuses a message so screen readers read it first; it
   is not a control, so no focus ring */
.auth-card [role="alert"][tabindex="-1"]:focus,
.auth-card [role="status"][tabindex="-1"]:focus {
  outline: none;
}

.auth-title {
  margin: 0;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-card-title);
  font-weight: var(--weight-bold);
  line-height: 1.12;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.auth-lede {
  margin: 10px 0 0;
  color: var(--color-muted);
  font-size: var(--text-md);
  line-height: 1.5;
  text-wrap: pretty;
}

.auth-lede--form {
  margin: 0 0 var(--space-5);
}

.auth-card p {
  text-wrap: pretty;
}

/* Large, clear controls (16px text keeps iOS from zooming the page) */
.auth .ui-field {
  margin-bottom: var(--space-5);
}

.auth .ui-input {
  height: 50px;
  padding: 0 14px;
  font-size: var(--text-md);
}

.auth .ui-input-wrap > .ui-input {
  padding-right: 54px;
}

.auth .ui-input-wrap__btn {
  top: 3px;
  right: 3px;
  width: 44px;
  height: 44px;
}

.auth .ui-input-wrap__btn .ui-icon {
  width: 20px;
  height: 20px;
}

/* Read only account row on the password change form */
.auth-account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0 0 var(--space-5);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--color-track);
  color: var(--color-text);
  font-size: var(--text-base);
}

.auth-account .ui-icon {
  width: 18px;
  height: 18px;
  color: var(--color-muted);
}

.auth-account b {
  overflow: hidden;
  color: var(--color-ink);
  font-weight: var(--weight-ui-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inline question with a one digit answer */
.auth-field--inline {
  grid-template-columns: minmax(0, 1fr) 84px;
  align-items: center;
  column-gap: var(--space-4);
}

.auth-field--inline .ui-input {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.auth .ui-check {
  margin: var(--space-1) 0 var(--space-5);
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.auth .ui-check > input {
  width: 20px;
  height: 20px;
  margin-top: 0;
}

/* Turnstile (m1n_turnstile_widget, size flexible: full width, 65px). The
   space is kept only once the widget is there: it may load on the first
   interaction with the form. */
.turnstile-wrap {
  margin: 0 0 var(--space-4);
}

.turnstile-wrap:has(> .cf-turnstile:empty) {
  margin: 0;
}

.cf-turnstile:not(:empty) {
  min-height: 65px;
}

/* Secondary line under the action */
.auth-foot {
  margin: var(--space-5) 0 0;
  color: var(--color-muted);
  font-size: var(--text-base);
  text-align: center;
}

.auth-foot a,
.auth-note a,
.auth-lede a {
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  font-weight: var(--weight-ui-medium);
  text-decoration: none;
}

@media (hover: hover) {
  .auth-foot a:hover,
  .auth-note a:hover,
  .auth-lede a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

.auth-note {
  margin: var(--space-4) 0 0;
  color: var(--color-muted);
  font-size: var(--text-base);
  line-height: 1.5;
}

.auth-card .ui-alert {
  margin-bottom: var(--space-5);
}

.auth-card .ui-alert a {
  font-weight: var(--weight-ui-medium);
}

.auth-actions {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* Second line under the login form: imported listings without an account */
.auth-foot--claim {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-line);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* Referral: the company that sent the link, above the title */
.auth-ref {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  margin: 0 0 var(--space-5);
}

.auth-ref .ui-tile {
  flex: none;
}

.auth-ref a {
  min-width: 0;
  overflow-wrap: anywhere;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  font-size: var(--text-base);
  text-decoration: underline;
  text-decoration-color: var(--color-line-strong);
  text-underline-offset: 3px;
}

@media (hover: hover) {
  .auth-ref a:hover {
    color: var(--color-ink);
    text-decoration-color: currentColor;
  }
}

/* Second column: plain text next to the card, no plate */
.auth-aside {
  margin-top: var(--space-10);
  padding: 0 var(--space-2);
}

.auth-aside__title {
  margin: 0;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.auth-aside__text {
  max-width: 52ch;
  margin: var(--space-4) 0 0;
  color: var(--color-text);
  font-size: var(--text-md);
  line-height: 1.6;
  text-wrap: pretty;
}

.auth-aside__text--muted {
  color: var(--color-muted);
  font-size: var(--text-base);
}

.auth-aside__text data {
  color: var(--color-ink);
  font-weight: var(--weight-ui-medium);
  font-variant-numeric: tabular-nums;
}

/* Registration: one real free company page from the directory */
.auth-example {
  max-width: 420px;
  margin: var(--space-5) 0 var(--space-2);
}

.auth-example .ui-dircard {
  width: 100%;
}

.auth-example__url {
  margin: 10px 0 0;
  overflow-wrap: anywhere;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.auth-example__url b {
  color: var(--color-ink);
  font-weight: var(--weight-ui-medium);
}

/* Desktop: card and the text column side by side, the text starts lower */
@media (min-width: 1024px) {
  .auth-layout--split {
    display: grid;
    grid-template-columns: 452px minmax(0, 420px);
    align-items: start;
    justify-content: center;
    gap: clamp(56px, 6vw, 104px);
    max-width: 1100px;
  }

  .auth-layout--split:has(.auth-aside--narrow) {
    grid-template-columns: 452px minmax(0, 380px);
  }

  .auth-aside {
    align-self: start;
    margin-top: 0;
    padding: var(--space-10) 0 0;
  }

  .auth-aside__title {
    font-size: var(--text-2xl);
  }
}

/* Phones: text links in the card get a 44px tap area */
/* Text links in the card: a 24px target with a mouse (WCAG 2.5.8), 44px on touch */
.auth-foot a,
.auth-note a,
.auth-ref a,
.auth .ui-field__label a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

@media (pointer: coarse) {
  .auth-foot a,
  .auth-note a,
  .auth-ref a,
  .auth .ui-field__label a {
    min-height: 44px;
    margin-block: -12px;
  }
}

/* Legal line */
.auth-legal {
  flex: none;
  padding: var(--space-4) 16px var(--space-6);
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
  text-align: center;
}

.auth-legal p {
  margin: 0;
}

.auth-legal a {
  white-space: nowrap;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-line-strong);
  text-underline-offset: 3px;
}

@media (hover: hover) {
  .auth-legal a:hover {
    color: var(--color-ink);
    text-decoration-color: currentColor;
  }
}

.auth-legal__sep {
  margin: 0 8px;
  color: var(--color-line-strong);
}

/* Phones */
@media (max-width: 767px) {
  .auth {
    padding-top: var(--space-6);
  }

  .auth-card {
    padding: var(--space-6) var(--space-5) var(--space-6);
    border-radius: var(--radius-lg);
  }

  .auth-head {
    margin-bottom: var(--space-5);
  }

  .site-header--auth .site-header__back {
    min-height: 44px;
  }
}

@media (max-width: 379px) {
  .auth {
    padding-inline: 12px;
  }

  .auth-card {
    padding-inline: var(--space-4);
  }
}
