/* =====================================================================
   MT-Themes v2: account pages (DESIGN.md §5 "Auth") + the 404 page.
   Split layout: the form on paper, the shop window (navy, one real
   storefront) on the inline-end side from 960px; form only below.
   Logical properties only. No gradients, no glass, no blobs.
   ===================================================================== */

/* `hidden` wins over the display of .field, .auth-notice and friends. */
.auth-page [hidden] {
  display: none !important;
}

.auth {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
}

@media (min-width: 960px) {
  .auth {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (min-width: 1280px) {
  .auth {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }
}

/* ---- Form side ---- */
.auth-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-inline: var(--s-4);
  background: var(--paper);
}

@media (min-width: 600px) {
  .auth-side {
    padding-inline: var(--s-7);
  }
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  min-height: var(--header-h);
  padding-block: var(--s-2);
}

.auth-top-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-4);
}

.auth-top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--link);
  font-weight: 500;
  text-decoration: none;
}

.auth-top-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-theme {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  cursor: pointer;
}

.auth-theme:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.auth-theme .icon-sun,
.auth-theme[aria-pressed='true'] .icon-moon {
  display: none;
}

.auth-theme[aria-pressed='true'] .icon-sun {
  display: block;
}

.auth-main {
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  padding-block: var(--s-6) var(--s-7);
}

.auth-main:focus {
  outline: none;
}

@media (min-width: 960px) {
  .auth-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.auth-main h1,
.auth-main .auth-h1 {
  font-size: var(--fs-4);
  line-height: var(--lh-tight);
  color: var(--ink);
  margin-block-end: var(--s-2);
}

@media (min-width: 960px) {
  .auth-main h1,
  .auth-main .auth-h1 {
    font-size: var(--fs-5);
  }
}

.auth-lead {
  color: var(--ink-2);
  margin-block-end: var(--s-5);
}

.auth-quiet {
  color: var(--ink-3);
  font-size: var(--fs-0);
}

/* ---- Form ---- */
.auth-form {
  display: grid;
  gap: var(--s-5);
}

.auth-field label {
  color: var(--ink);
}

.req {
  color: var(--danger);
  margin-inline-start: 2px;
}

.auth-control {
  position: relative;
}

/* A control with a button inside (password) is an LTR field in both
   languages: the button sits at the field's own inline-end, where its
   padding is, so typed text never runs under it. */
.auth-control.has-after {
  direction: ltr;
}

.auth-control.has-after input {
  padding-inline-end: 52px;
}

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

.auth-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-field input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.auth-field select {
  cursor: pointer;
}

.field-error {
  display: flex;
  gap: var(--s-1);
  margin: 0;
  font-weight: 500;
}

.field-error[hidden] {
  display: none;
}

.auth-reveal {
  position: absolute;
  inset-block: 2px;
  inset-inline-end: 2px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  padding: 0;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: var(--r-1);
  cursor: pointer;
}

.auth-reveal:hover {
  color: var(--ink);
}

.auth-reveal .icon-hide,
.auth-reveal[aria-pressed='true'] .icon-show {
  display: none;
}

.auth-reveal[aria-pressed='true'] .icon-hide {
  display: block;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin-block-start: calc(-1 * var(--s-2));
}

.auth-row a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--link);
  font-weight: 500;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  cursor: pointer;
}

.auth-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--blue-deep);
}

.auth-recaptcha {
  min-height: 78px;
  overflow: visible;
}

/* The reCAPTCHA widget is a fixed 304px iframe: never give it a scrollbar;
   on very narrow screens scale it down from its start edge instead. */
.auth-recaptcha .g-recaptcha {
  display: inline-block;
  transform-origin: top right;
}

[dir='ltr'] .auth-recaptcha .g-recaptcha {
  transform-origin: top left;
}

@media (max-width: 359px) {
  .auth-recaptcha {
    min-height: 68px;
  }

  .auth-recaptcha .g-recaptcha {
    transform: scale(0.86);
  }
}

.auth-submit {
  width: 100%;
  position: relative;
}

.auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-submit.is-loading .btn-text {
  visibility: hidden;
}

.auth-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  border-block-start-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

.auth-spinner[hidden] {
  display: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .auth-spinner {
    animation-duration: 2.4s;
  }
}

.auth-links {
  display: grid;
  margin-block-start: var(--s-6);
  padding: var(--s-4) 0 0;
  border-block-start: 1px solid var(--line);
  list-style: none;
  color: var(--ink-2);
}

.auth-links li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--s-1);
}

.auth-links a,
.auth-textlink {
  color: var(--link);
  font-weight: 600;
}

.auth-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.auth-textlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.auth-foot {
  padding-block: var(--s-4) var(--s-5);
  text-align: center;
}

.auth-staff {
  margin: 0;
  font-size: var(--fs-0);
}

.auth-staff a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-3);
}

.auth-staff a:hover {
  color: var(--link);
}

/* ---- Notices ---- */
.auth-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  margin-block-end: var(--s-5);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--paper-2);
  color: var(--ink);
  font-size: var(--fs-1);
  line-height: 1.6;
}

.auth-notice[hidden],
.auth-message[hidden] {
  display: none;
}

.auth-notice > .icon {
  flex: none;
  margin-block-start: 2px;
}

.auth-notice p {
  margin: 0;
}

.auth-notice-title {
  font-weight: 700;
}

.auth-notice.is-info > .icon,
.auth-notice.is-store > .icon {
  color: var(--link);
}

.auth-notice.is-store {
  background: var(--blue-tint);
  border-color: transparent;
}

.auth-notice.is-warning {
  border-color: #e7b54a;
  background: #fff8e6;
  color: #5c3d00;
}

.auth-notice.is-warning > .icon {
  color: #a15c00;
}

.auth-countdown .num {
  font-weight: 600;
}

/* Zid guest info (inserted by the page JS after a field). */
.auth-zid {
  margin: 0;
}

/* ---- Status pages (reset / verify) ---- */
.auth-status-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-block-end: var(--s-4);
  border-radius: var(--r-pill);
  background: var(--blue-tint);
  color: var(--blue-ink);
}

.auth-status-icon .icon {
  width: 24px;
  height: 24px;
}

.auth-status.is-success .auth-status-icon {
  background: #e3f4e9;
  color: var(--ok);
}

.auth-status.is-warning .auth-status-icon {
  background: #fff1d6;
  color: #8a4b00;
}

.auth-status[hidden] {
  display: none;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-5);
  margin-block-start: var(--s-5);
}

.auth-h2 {
  font-size: var(--fs-2);
  margin-block: var(--s-4) var(--s-2);
}

.auth-creds {
  display: grid;
  gap: var(--s-2);
  margin: 0 0 var(--s-5);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--paper-2);
}

.auth-creds div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2);
}

.auth-creds dt {
  color: var(--ink-2);
}

.auth-creds dd {
  margin: 0;
  font-weight: 600;
}

/* ---- Support staff (/chat/employee/*) ---- */
.auth-row.is-end {
  justify-content: flex-end;
}

.auth-creds bdi {
  overflow-wrap: anywhere;
}

.auth-notice.is-success {
  border-color: var(--ok);
  background: #edf8f1;
}

.auth-notice.is-success > .icon {
  color: var(--ok);
}

:root[data-theme='dark'] .auth-notice.is-success {
  background: #11271a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .auth-notice.is-success {
    background: #11271a;
  }
}

.auth-stores {
  display: grid;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-store {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 64px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition:
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.auth-store::after {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-inline-start: auto;
  border-block-start: 2px solid var(--ink-3);
  border-inline-end: 2px solid var(--ink-3);
  transform: rotate(45deg);
}

[dir='rtl'] .auth-store::after {
  transform: rotate(-45deg);
}

.auth-store:hover {
  border-color: var(--blue);
  background: var(--blue-tint);
}

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

.auth-store:disabled {
  cursor: progress;
  opacity: 0.6;
}

.auth-store-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.auth-store-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.auth-store-role {
  color: var(--ink-2);
  font-size: var(--fs-0);
}

/* ---- Shop window (navy, inline-end) ---- */
.auth-panel {
  display: none;
}

@media (min-width: 960px) {
  .auth-panel {
    display: block;
    background: var(--navy);
    color: var(--on-navy);
  }

  .auth-panel-inner {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--s-8) clamp(2rem, 5vw, 5rem);
  }
}

.auth-panel-line {
  max-width: 24ch;
  margin: 0 0 var(--s-2);
  font-size: var(--fs-4);
  font-weight: 700;
  line-height: var(--lh-tight);
  text-wrap: balance;
  color: var(--on-navy);
}

.auth-panel-sub {
  max-width: 46ch;
  margin: 0 0 var(--s-7);
  color: var(--on-navy-2);
}

.auth-stage {
  position: relative;
  padding-inline-end: 14%;
  padding-block-end: var(--s-6);
}

.auth-stage .frame {
  border-color: var(--navy-2);
}

.auth-stage .phone {
  position: absolute;
  inset-inline-end: 0;
  inset-block-end: 0;
  width: 24%;
  min-width: 96px;
  outline-color: var(--navy-2);
  box-shadow: var(--shadow-3);
}

.auth-panel-cap {
  margin: var(--s-4) 0 0;
  font-size: var(--fs-0);
  color: var(--on-navy-2);
}

/* ---- Dark mode: the semantic tints ---- */
:root[data-theme='dark'] .auth-notice.is-warning {
  background: #2d2410;
  border-color: #8a6a1f;
  color: #f5d99a;
}

:root[data-theme='dark'] .auth-status.is-success .auth-status-icon {
  background: #11271a;
  color: #9fe0b5;
}

:root[data-theme='dark'] .auth-status.is-warning .auth-status-icon {
  background: #2d2410;
  color: #f5d99a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .auth-notice.is-warning {
    background: #2d2410;
    border-color: #8a6a1f;
    color: #f5d99a;
  }

  :root:not([data-theme='light']) .auth-status.is-success .auth-status-icon {
    background: #11271a;
    color: #9fe0b5;
  }

  :root:not([data-theme='light']) .auth-status.is-warning .auth-status-icon {
    background: #2d2410;
    color: #f5d99a;
  }
}

/* ---- 404 (site layout, one column) ---- */
.nf-inner {
  max-width: 640px;
}

.nf-code {
  margin: 0 0 var(--s-2);
  font-size: var(--fs-5);
  color: var(--link);
}

.nf h1 {
  margin-block-end: var(--s-3);
}

.nf-lead {
  color: var(--ink-2);
  margin-block-end: var(--s-6);
}

.nf-search-row {
  display: flex;
  gap: var(--s-2);
}

.nf-search-row input {
  flex: 1;
  min-width: 0;
}

.nf-search-row .btn {
  flex: none;
}

.nf-h2 {
  font-size: var(--fs-2);
  margin-block: var(--s-7) var(--s-3);
}

.nf-links {
  display: grid;
  gap: var(--s-1);
  padding: 0;
  list-style: none;
}

.nf-links .link-arrow {
  min-height: 44px;
}

/* ---- Ad board: our themes and apps, one at a time with a fade ---- */
.promo-eyebrow {
  position: relative;
  margin: 0 0 var(--s-6);
  padding-block-end: var(--s-3);
  font-size: var(--fs-3);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: #dbe7ff;
}

.promo-eyebrow::after {
  content: '';
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: 44px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #3b82f6, #9cc0ff);
}

.promo-deck {
  display: grid;
}

.promo {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.7s ease,
    visibility 0s linear 0.7s;
}

.promo.is-active {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.7s ease,
    visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
  .promo,
  .promo.is-active {
    transition: none;
  }
}

.promo .auth-stage {
  padding-block-end: var(--s-5);
}

.promo-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.promo-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
  font-size: var(--fs-0);
  color: var(--on-navy-2);
}

.promo-name {
  margin: 0;
  font-size: var(--fs-4);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--on-navy);
}

.promo-desc {
  max-width: 52ch;
  margin: 0;
  color: var(--on-navy-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.promo-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  margin-block-start: var(--s-2);
}

.promo-price .price,
.promo-price .price-was {
  color: var(--on-navy);
}

.promo-price .price-was,
.promo-price .price-cur {
  color: var(--on-navy-2);
}

.promo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: 44px;
  font-weight: 600;
  color: #9cc0ff;
  text-decoration: none;
}

.promo-link:hover,
.promo-link:focus-visible {
  text-decoration: underline;
}

.promo-link .icon {
  width: 18px;
  height: 18px;
}

.promo-dots {
  display: flex;
  gap: var(--s-2);
  margin-block-start: var(--s-5);
}

.promo-dot {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
}

.promo-dot::before {
  content: '';
  position: absolute;
  inset: 11px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  transition: background 0.2s;
}

.promo-dot[aria-current='true']::before {
  background: #9cc0ff;
}

.promo-dot:focus-visible {
  outline: 2px solid #9cc0ff;
  outline-offset: 2px;
  border-radius: 6px;
}

.promo .auth-stage.no-phone {
  padding-inline-end: 0;
}

/* Fanned pictures: the first in front, two tilted behind it */
.promo-fan {
  position: relative;
  aspect-ratio: 16 / 10;
  margin-block-end: var(--s-2);
}

.promo-fan-item {
  position: absolute;
  margin: 0;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.9s ease,
    inset-inline-start 0.9s ease,
    opacity 0.9s ease,
    inset-block-start 0.9s ease,
    width 0.9s ease;
}

.promo-fan-frames .promo-fan-item {
  width: 66%;
  inset-block-start: 12%;
}

.promo-fan-frames .fan-front {
  z-index: 3;
  inset-inline-start: 17%;
  inset-block-start: 20%;
  width: 68%;
}

.promo-fan-frames .fan-start {
  z-index: 1;
  inset-inline-start: 0;
  transform: rotate(-6deg);
}

.promo-fan-frames .fan-end {
  z-index: 2;
  inset-inline-start: 34%;
  transform: rotate(6deg);
}

.promo-fan-phones {
  aspect-ratio: 16 / 11;
}

.promo-fan-phones .promo-fan-item {
  width: 30%;
  inset-block-start: 6%;
  outline-color: var(--navy-2);
}

.promo-fan-phones .fan-front {
  z-index: 3;
  inset-inline-start: 35%;
  inset-block-start: 0;
  width: 32%;
}

.promo-fan-phones .fan-start {
  z-index: 1;
  inset-inline-start: 8%;
  transform: rotate(-8deg);
}

.promo-fan-phones .fan-end {
  z-index: 2;
  inset-inline-start: 62%;
  transform: rotate(8deg);
}

.promo-fan-n2 .fan-front {
  inset-inline-start: 30%;
}

.promo-fan-frames .fan-back,
.promo-fan-plain .fan-back {
  z-index: 0;
  inset-inline-start: 17%;
  inset-block-start: 14%;
  width: 60%;
  opacity: 0;
}

.promo-fan-phones .fan-back {
  z-index: 0;
  inset-inline-start: 35%;
  width: 28%;
  opacity: 0;
}

.promo-fan-item {
  opacity: 1;
}

.promo:not(.is-active) .fan-start {
  transform: rotate(0deg);
}

.promo:not(.is-active) .fan-end {
  transform: rotate(0deg);
}

@media (prefers-reduced-motion: reduce) {
  .promo-fan-item {
    transition: none;
  }
}

.promo-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #fff;
}

/* The app-theme screenshots are 3-phone mockups on a light backdrop: show
   only the middle phone's screen, inside our own dark bezel. */
.promo-shot {
  aspect-ratio: 406 / 857;
  overflow: hidden;
  border: 5px solid #05080f;
  border-radius: 30px;
  background: #fff;
}

.promo-shot img {
  position: absolute;
  top: -29%;
  left: -213.2%;
  width: 526.3%;
  max-width: none;
  height: auto;
}

/* ---- Ad board backdrop: calm dark-blue glows drifting under a faint grid ---- */
@media (min-width: 960px) {
  .auth-panel {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
      radial-gradient(900px 520px at 85% -10%, rgba(59, 130, 246, 0.22), transparent 60%),
      radial-gradient(800px 480px at 0% 110%, rgba(30, 58, 138, 0.35), transparent 60%), var(--navy);
  }

  .auth-panel::before,
  .auth-panel::after {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: -1;
  }

  /* the grid, fading out towards the edges */
  .auth-panel::before {
    inset: 0;
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 30%, transparent 78%);
    mask-image: radial-gradient(ellipse at 50% 45%, #000 30%, transparent 78%);
    animation: promoGrid 24s linear infinite;
  }

  /* one slow blue glow wandering behind the pictures */
  .auth-panel::after {
    width: 70%;
    aspect-ratio: 1;
    inset-block-start: 10%;
    inset-inline-start: 15%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.3), transparent 65%);
    filter: blur(20px);
    animation: promoGlow 18s ease-in-out infinite alternate;
  }
}

@keyframes promoGrid {
  to {
    background-position:
      0 44px,
      44px 0;
  }
}

@keyframes promoGlow {
  0% {
    transform: translate(-12%, -6%) scale(1);
  }

  50% {
    transform: translate(10%, 8%) scale(1.15);
  }

  100% {
    transform: translate(-4%, 14%) scale(0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-panel::before,
  .auth-panel::after {
    animation: none;
  }
}

/* Screens captured from the apps' own demos: they carry their window chrome */
.promo-fan-plain .promo-fan-item {
  width: 66%;
  inset-block-start: 12%;
}

.promo-fan-plain .fan-front {
  z-index: 3;
  inset-inline-start: 17%;
  inset-block-start: 20%;
  width: 68%;
}

.promo-fan-plain .fan-start {
  z-index: 1;
  inset-inline-start: 0;
  transform: rotate(-6deg);
}

.promo-fan-plain .fan-end {
  z-index: 2;
  inset-inline-start: 34%;
  transform: rotate(6deg);
}

.promo-plain {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

.promo-plain img {
  display: block;
  width: 100%;
  height: auto;
}

/* =====================================================================
   Form side, v3: a plain, quiet column in the style of the best product
   sign-ins. White surface, no card, no backdrop art; one 400px column
   centred in the side; small 44px controls; a solid primary button; the
   secondary actions as a single text line. The top bar and the footer are
   slim and muted so the form carries the page.
   ===================================================================== */
.auth-side {
  background: var(--paper);
}

@media (min-width: 600px) {
  .auth-side {
    padding-inline: var(--s-6);
  }
}

/* top bar */
.auth-top {
  min-height: 72px;
  padding-block: var(--s-3);
}

.auth-top .wordmark {
  font-size: 1.6rem;
}

.auth-top-nav {
  gap: var(--s-2);
}

.auth-top-link {
  min-height: 36px;
  min-width: 0;
  padding-inline: var(--s-2);
  border-radius: 8px;
  font-size: var(--fs-0);
  font-weight: 500;
  color: var(--ink-2);
}

.auth-top-link:hover {
  color: var(--ink);
  text-decoration: none;
  background: var(--paper-2);
}

.auth-top-link[hreflang] {
  padding-inline: var(--s-3);
  border: 1px solid var(--line);
  color: var(--ink);
}

.auth-theme {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
}

.auth-theme:hover {
  background: var(--paper-2);
  color: var(--ink);
}

/* phones: one row; the wordmark already links home, so "back to site" goes */
@media (max-width: 479px) {
  .auth-top {
    flex-wrap: nowrap;
  }

  .auth-top-nav > .auth-top-link:not([hreflang]) {
    display: none;
  }
}

/* the column */
.auth-main {
  max-width: 400px;
  padding-block: var(--s-6) var(--s-7);
}

@media (min-width: 960px) {
  .auth-main {
    flex: 1 0 auto;
    padding-block: var(--s-5);
  }
}

.auth-main h1,
.auth-main .auth-h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-block-end: var(--s-2);
}

.auth-lead {
  font-size: 0.9375rem;
  color: var(--ink-2);
  margin-block-end: var(--s-6);
}

/* fields */
.auth-form {
  gap: var(--s-4);
}

.auth-field {
  gap: 6px;
}

.auth-field label {
  font-size: var(--fs-0);
  font-weight: 600;
  color: var(--ink);
}

/* required is announced to screen readers ("(required)"); no red stars */
.auth-field .req {
  display: none;
}

.auth-field input,
.auth-field select {
  min-height: 44px;
  padding-block: 0;
  padding-inline: 0.875rem;
  font-size: 0.9375rem;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.auth-field input:hover,
.auth-field select:hover {
  border-color: color-mix(in srgb, var(--ink) 35%, var(--line-strong));
}

.auth-field input:focus,
.auth-field select:focus {
  outline: none;
  border-color: var(--blue-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent);
}

/* browser autofill: keep the field white, not the browser's blue */
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--card) inset;
  caret-color: var(--ink);
}

.auth-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow:
    0 0 0 1000px var(--card) inset,
    0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent);
}

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

.auth-field input[aria-invalid='true']:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent);
}

.field-error,
.field-help {
  font-size: 0.8125rem;
}

/* LTR fields in an RTL page read left-to-right */
[dir='rtl'] .auth-field input[dir='ltr'] {
  text-align: left;
}

/* password: the eye sits at the field's end, inside it */
.auth-control.has-after input {
  padding-inline-end: 44px;
}

.auth-reveal {
  inset-block: 1px;
  inset-inline-end: 1px;
  width: 42px;
  color: var(--ink-3);
  border-radius: 7px;
}

.auth-reveal .icon {
  width: 18px;
  height: 18px;
}

/* remember me / forgot */
.auth-row {
  margin-block: calc(-1 * var(--s-2)) 0;
  font-size: var(--fs-0);
}

.auth-row a {
  min-height: 36px;
  font-weight: 500;
  text-decoration: none;
}

.auth-row a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-check {
  min-height: 36px;
  gap: var(--s-2);
  color: var(--ink-2);
}

.auth-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue-deep);
}

/* reCAPTCHA sits at the start, like every other field */
.auth-recaptcha {
  display: flex;
  justify-content: flex-start;
}

/* primary button */
.auth-submit {
  min-height: 44px;
  margin-block-start: var(--s-1);
  padding-inline: var(--s-4);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  border: 1px solid var(--blue-deep);
  border-radius: 8px;
  background: var(--blue-deep);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background-color 0.15s;
}

.auth-submit:hover:not(:disabled) {
  background: color-mix(in srgb, var(--blue-deep) 88%, #000);
}

.auth-submit:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--paper),
    0 0 0 4px var(--blue-deep);
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit,
  .auth-field input {
    transition: none;
  }
}

/* secondary actions: one quiet text line each, no divider, no second button */
.auth-links {
  gap: 2px;
  margin-block-start: var(--s-5);
  padding: 0;
  border: 0;
  font-size: var(--fs-0);
  text-align: center;
}

.auth-links li {
  justify-content: center;
}

.auth-links a {
  min-height: 32px;
  font-weight: 600;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-links a.auth-quietlink {
  font-weight: 500;
  color: var(--ink-3);
}

.auth-links a.auth-quietlink:hover {
  color: var(--ink-2);
}

/* notices inside the column */
.auth-notice {
  border-radius: 8px;
  font-size: var(--fs-0);
}

/* footer */
.auth-foot {
  padding-block: var(--s-3) var(--s-4);
  text-align: center;
}

.auth-staff a {
  min-height: 36px;
  font-size: 0.8125rem;
  color: var(--ink-3);
  text-decoration: none;
}

.auth-staff a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Smaller pictures on the ad board: the fan never grows past ~580px wide,
   and the phones sit in a shorter stage, so the text stays in view. */
.promo-fan,
.promo .auth-stage {
  width: 100%;
  max-width: 580px;
  margin-inline: auto;
}

.promo-fan-phones {
  max-width: 500px;
  aspect-ratio: 16 / 12;
}

.promo-fan-phones .promo-fan-item {
  width: 27%;
}

.promo-fan-phones .fan-front {
  inset-inline-start: 36.5%;
  width: 29%;
}

.promo-fan-phones .fan-start {
  inset-inline-start: 11%;
}

.promo-fan-phones .fan-end {
  inset-inline-start: 62%;
}

.promo-visual {
  display: flex;
  justify-content: center;
}

.promo {
  gap: var(--s-4);
}

.promo-eyebrow {
  margin-block-end: var(--s-5);
}

/* "Zid themes" / "Salla themes": the group name above the rotating theme */
.promo-group {
  margin: 0 0 calc(-1 * var(--s-2));
  font-size: var(--fs-0);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #9cc0ff;
}

/* an Arabic placeholder in an LTR password field reads from the right */
[dir='rtl'] .auth-control.has-after input:placeholder-shown {
  text-align: right;
}

/* ---- Toast (#toast): a small card at the top of the form side ----
   RTL: top right; LTR: top left (the reading start, where the form is). */
.auth-message {
  position: fixed;
  z-index: 1000;
  inset-block-start: 20px;
  inset-inline-start: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  margin: 0;
  padding: 12px 12px 12px 14px;
  font-size: var(--fs-0);
  line-height: 1.55;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--toast-accent, var(--blue-deep));
  border-radius: 10px;
  box-shadow:
    0 10px 30px -8px rgba(15, 23, 42, 0.22),
    0 2px 6px rgba(15, 23, 42, 0.06);
}

[dir='rtl'] .auth-message {
  padding: 12px 14px 12px 12px;
}

.auth-message:focus {
  outline: none;
}

.auth-message.is-success {
  --toast-accent: var(--ok);
}

.auth-message.is-error {
  --toast-accent: var(--danger);
}

.auth-message.is-warning {
  --toast-accent: #d97706;
}

.auth-message.is-info {
  --toast-accent: var(--blue-deep);
}

.auth-message-icon {
  flex: none;
  margin-block-start: 1px;
  color: var(--toast-accent, var(--blue-deep));
}

.auth-message-text {
  flex: 1;
  min-width: 0;
  padding-block-start: 1px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.auth-message-close {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -4px;
  padding: 0;
  color: var(--ink-3);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.auth-message-close:hover {
  color: var(--ink);
  background: var(--paper-2);
}

.auth-message-close svg {
  width: 16px;
  height: 16px;
}

.auth-message.is-in {
  animation: auth-toast-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

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

@media (max-width: 599px) {
  .auth-message {
    inset-block-start: 12px;
    inset-inline: 16px;
    width: auto;
  }
}
