/* =========================================================================
   Micro Jobs Africa — auth pages (sign up, login)
   A centred card floating on the full-bleed wave backdrop.
   ====================================================================== */

/*
 * The column is minmax(0, 1fr), never a bare auto track: an auto track grows
 * to its widest content — the country select is as wide as its longest
 * country name, and a phone with large text or display zoom widens every
 * label — so the column ended up wider than the screen and overflow:hidden
 * cut the card's right side off (owner's phone, 2026-09-19). The same
 * min-width: 0 chain runs down through the card, the form and each field.
 */
.auth {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 40px 18px 56px;
  overflow: hidden;
}

/* -------------------------------------------------------------- backdrop */

/* Each wave group is anchored to its own edge, so the composition survives
   any aspect ratio instead of being a portrait artboard blown up and cropped. */
.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.auth-bg > * { position: absolute; }

.auth-bg__wash--green {
  left: -20vw;
  top: -24vh;
  width: 80vw;
  height: 80vh;
  background: radial-gradient(closest-side, #EAF1EC, rgba(234, 241, 236, 0));
}

.auth-bg__wash--gold {
  right: -14vw;
  top: 34%;
  width: 52vw;
  height: 52vh;
  background: radial-gradient(closest-side, rgba(250, 200, 118, .16), rgba(250, 200, 118, 0));
}

.auth-bg__rings--top {
  top: -34px;
  left: 52%;
  width: 240px;
  height: 240px;
}

.auth-bg__rings--bottom {
  right: -30px;
  bottom: 14%;
  width: 250px;
  height: 250px;
}

.auth-bg__dots {
  color: rgba(0, 132, 42, .18);
  background-size: 24px 20px;
}

.auth-bg__dots--tl { left: 5%;  top: 13%; width: 110px; height: 78px; }
.auth-bg__dots--r  { right: 4%; top: 46%; width: 88px;  height: 98px; }

.auth__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* ------------------------------------------------------------- brand lockup */

.auth__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.auth__mark { width: 86px; height: 86px; }

.auth__wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth__wordmark-1 { font-size: 1.95rem; color: var(--c-heading); }
.auth__wordmark-2 { font-size: 1.5rem;  color: var(--c-green); }

/* --------------------------------------------------------------------- card */

.auth__card {
  width: 100%;
  min-width: 0;
  padding: 40px 30px 34px;
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: 0 40px 90px -50px rgba(11, 59, 38, .45),
              0 6px 20px -12px rgba(11, 59, 38, .12);
}

.auth__title {
  font-size: clamp(1.6rem, 6vw, 2.05rem);
  text-align: center;
}
.auth__title span { color: var(--c-gold-deep); }

.auth__lede {
  max-width: 34ch;
  margin: 12px auto 0;
  text-align: center;
  font-size: .95rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------- form */

.auth__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 30px;
}

.afield-wrap { display: block; min-width: 0; }

.afield {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.afield:focus-within {
  border-color: var(--c-green-bright);
  box-shadow: 0 0 0 4px rgba(31, 163, 71, .13);
}

.afield__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--c-green);
}
.afield__icon svg { width: 100%; height: 100%; }

.afield__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 16px 0;
  border: 0;
  background: transparent;
  font-size: .95rem;
  color: var(--c-heading);
}
.afield__input::placeholder { color: var(--c-muted-soft); }
.afield__input:focus { outline: none; }

.afield__toggle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-green);
  transition: color .2s ease, transform .2s ease;
}
.afield__toggle svg { width: 20px; height: 20px; }
.afield__toggle:hover { color: var(--c-green-bright); transform: scale(1.06); }

/* ------------------------------------------------- select, prefix, errors */

/* width: 100% lets a long country name shrink to the field instead of
   stretching it; the chosen name is cut with an ellipsis if it must be. */
.afield__select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* An unchosen select shows its placeholder in the placeholder colour. */
.afield__select:invalid { color: var(--c-muted-soft); }
.afield__select option { color: var(--c-heading); }

.afield__chevron {
  position: absolute;
  right: 14px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--c-muted-soft);
  pointer-events: none;
  transform: rotate(90deg);
}
.afield__chevron svg { width: 100%; height: 100%; }

.afield__prefix {
  flex: 0 0 auto;
  padding-right: 10px;
  margin-right: 2px;
  border-right: 1px solid var(--c-line);
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
  color: var(--c-muted-soft);
  transition: color .2s ease;
}
.afield__prefix.is-set { color: var(--c-heading); font-weight: 600; }

.afield--error { border-color: #E5271B; }
.afield--error:focus-within {
  border-color: #E5271B;
  box-shadow: 0 0 0 4px rgba(229, 39, 27, .14);
}
.afield--error .afield__icon { color: #E5271B; }

.afield__error {
  margin: 6px 2px 0;
  font-size: .8rem;
  line-height: 1.45;
  color: #E5271B;
}


/* ------------------------------------------------------------------- terms */

.auth__terms {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 2px;
  font-size: .87rem;
  line-height: 1.5;
  cursor: pointer;
}

.auth__check {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
}

.auth__box {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  border: 1.6px solid var(--c-line);
  border-radius: 4px;
  color: transparent;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.auth__box svg { width: 12px; height: 12px; }

.auth__check:checked + .auth__box {
  background: var(--c-green);
  border-color: var(--c-green);
  color: #fff;
}

.auth__check:focus-visible + .auth__box {
  outline: 3px solid var(--c-green-bright);
  outline-offset: 2px;
}

.auth__terms-text a {
  color: var(--c-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth__terms-text a:hover { color: var(--c-green-deep); }

/* Remember-me on the left, forgot-password on the right. */
.auth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.auth__terms--inline { margin-top: 0; }

.auth__link {
  font-size: .85rem;
  font-weight: 600;
  color: var(--c-green);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.auth__link:hover { color: var(--c-green-deep); }

/* The submit arrow parks at the right edge, label stays centred. */
.btn.auth__submit {
  --btn-py: 18px;
  margin-top: 6px;
  font-size: 1rem;
  border-radius: var(--r-sm);
}
.btn.auth__submit .btn__icon {
  position: absolute;
  right: 24px;
}

/* ---------------------------------------------------------------- alt link */

/* The "or continue with" divider and the two social buttons that used to sit
   between the form and this link were removed with social sign-in. The link
   now follows the submit button directly, which is the same shape logout.php
   has always shipped — so the extra margin here is what replaces the ~120px
   of content that used to separate them. */

.auth__alt {
  margin-top: 26px;
  text-align: center;
  font-size: .9rem;
}

.auth__alt a {
  color: var(--c-green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth__alt a:hover { color: var(--c-green-deep); }

/* =========================================================================
   ≥ 560px — the name fields pair up and the card gets roomier
   ====================================================================== */

/* ------------------------------------------------- activation extras */

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.auth__hurray {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 13px 16px;
  background: var(--c-chip);
  border-radius: var(--r-sm);
  font-size: .92rem;
  font-weight: 600;
  text-align: center;
  color: var(--c-green-deep);
}

.auth__hurray-mark { font-size: 1.2rem; }

.auth__aside {
  margin-top: 24px;
  padding: 16px 18px;
  background: var(--c-surface-soft);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
}

.auth__aside-title {
  margin-bottom: 4px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--c-heading);
}

.auth__aside-text { font-size: .85rem; line-height: 1.6; }
.auth__aside-text a { color: var(--c-green); text-decoration: underline; }

/* ------------------------------------------------ success / dashboard */

.auth__card--centred { text-align: center; }
.auth__card--centred .auth__lede { margin-left: auto; margin-right: auto; }

.auth__seal {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(0, 122, 42, .8);
}
.auth__seal svg { width: 30px; height: 30px; }

.auth__eyebrow {
  margin-bottom: 10px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--c-green);
}

.auth__summary {
  display: grid;
  gap: 1px;
  margin: 26px 0 24px;
  background: var(--c-line);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  overflow: hidden;
  text-align: left;
}

.auth__summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--c-surface-soft);
}

.auth__summary dt {
  font-size: .82rem;
  color: var(--c-muted);
}

.auth__summary dd {
  margin: 0;
  font-size: .9rem;
  font-weight: 600;
  color: var(--c-heading);
  word-break: break-word;
  text-align: right;
}

/* Small phones, and phones with display zoom or large text: a little less
   side padding, so the fields keep their width instead of the card's edge. */
@media (max-width: 400px) {
  .auth { padding-left: 14px; padding-right: 14px; }
  .auth__card { padding: 32px 20px 28px; }
}

@media (min-width: 560px) {
  .auth__card { padding: 46px 46px 38px; }
}

@media (min-width: 1024px) {
  .auth { padding: 56px 24px 72px; }
  .auth__inner { max-width: 620px; gap: 34px; }
  .auth__inner--narrow { max-width: 520px; }
}

/* --------------------------------------------------------- locked field
   A value the member can see but not change (country, set at signup). Same
   box as .afield so it lines up with the editable fields around it.
   -------------------------------------------------------------------- */

.afield--locked {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--c-line-soft);
  cursor: not-allowed;
}

.afield__static {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .92rem;
  font-weight: 600;
  color: var(--c-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.afield__lock { display: grid; place-items: center; color: var(--c-muted-soft); }
.afield__lock svg { width: 16px; height: 16px; }

.afield__hint {
  margin-top: 6px;
  font-size: .72rem;
  color: var(--c-muted-soft);
}

/* The value inside a locked field: the invite code on sign-up. */
.afield__static strong { font-weight: 800; color: var(--c-heading); }

/* =========================================================================
   "By signing up, I agree…" and the panel it opens

   The tick box is gone; the sentence carries the agreement and the two
   documents open here instead of navigating away, so a half-filled form
   survives somebody deciding to read the terms.
   ====================================================================== */

.auth__agree {
  margin: 2px 0 0;
  font-size: .84rem;
  line-height: 1.6;
  color: var(--c-muted);
}

/* A button, because it opens a panel — but it has to read as a link. */
.auth__agree-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--c-green);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.auth__agree-link:hover { color: var(--c-green-deep); }

.legal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: end center;
}
.legal[hidden] { display: none; }

@media (min-width: 720px) { .legal { place-items: center; } }

.legal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 40, 26, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .28s ease;
}
.legal.is-in .legal__scrim { opacity: 1; }

.legal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 680px);
  max-height: min(86vh, 720px);
  border-radius: 22px 22px 0 0;
  background: var(--c-surface);
  box-shadow: 0 -20px 60px rgba(8, 40, 26, .3);
  transform: translateY(26px);
  opacity: 0;
  transition: transform .32s cubic-bezier(.2, .8, .25, 1), opacity .32s ease;
}
.legal.is-in .legal__panel { transform: none; opacity: 1; }

@media (min-width: 720px) {
  .legal__panel { border-radius: 20px; max-height: 80vh; }
}

.legal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--c-line);
}

.legal__title { flex: 1 1 auto; margin: 0; font-size: 1.08rem; font-weight: 800; color: var(--c-heading); }

.legal__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-muted);
  cursor: pointer;
}
.legal__close:hover { background: var(--c-surface-soft); color: var(--c-heading); }
.legal__close svg { width: 16px; height: 16px; }

.legal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px;
  font-size: .9rem;
  line-height: 1.75;
  color: var(--c-ink);
  -webkit-overflow-scrolling: touch;
}
.legal__body h2 { margin: 22px 0 8px; font-size: 1rem; color: var(--c-heading); }
.legal__body h2:first-child { margin-top: 0; }
.legal__body h3 { margin: 16px 0 6px; font-size: .92rem; color: var(--c-heading); }
.legal__body p { margin: 0 0 10px; }
.legal__body ul, .legal__body ol { margin: 0 0 12px; padding-left: 20px; }
.legal__body li { margin-bottom: 6px; }
.legal__body a { color: var(--c-green); font-weight: 600; }
.legal__loading { color: var(--c-muted); }

.legal__foot { padding: 14px 20px 18px; border-top: 1px solid var(--c-line); }

@media (prefers-reduced-motion: reduce) {
  .legal__scrim, .legal__panel { transition: opacity .15s ease; }
  .legal__panel { transform: none; }
}
