/* Sign-in, sign-up and forgot password (views/signin.php, signup.php, forgot-password.php): a split layout inside the
   website's menu and footer (owner's choice of 2026-11-09). On the left the site and what members can do
   (includes/auth-brand.php), on the right the card. Inputs, buttons and banners come from css/portal.css. See DESIGN.md. */

.auth-page {
  align-items: center;
  background:
    radial-gradient(circle at 12% 18%, rgba(27, 94, 32, 0.09), transparent 42%),
    radial-gradient(circle at 88% 84%, rgba(200, 100, 10, 0.08), transparent 42%),
    var(--off-white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - var(--header-h) - var(--topbar-h));     /* the space between the menu and the footer */
  overflow-wrap: anywhere;
  padding: 56px 24px 64px;
}
.auth-wrap {
  align-items: center;
  display: grid;
  gap: clamp(32px, 6vw, 104px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  max-width: 1060px;
  width: 100%;
}

/* ---- The site, and what members can do ---- */
.auth-brand { min-width: 0; }
.auth-logo { align-items: center; border-radius: var(--radius-md); color: var(--secondary-dark); display: inline-flex; gap: 14px; max-width: 100%; }
.auth-logo:focus-visible { outline: 3px solid var(--secondary); outline-offset: 4px; }
.auth-logo .logo-icon { border-radius: var(--radius-lg); flex: none; font-size: 2rem; height: 64px; width: 64px; }
.auth-logo .logo-icon img { height: 100%; object-fit: contain; width: 100%; }
.auth-logo-name { font-family: var(--font-serif); font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 800; line-height: 1.08; min-width: 0; }
.auth-tagline { color: var(--gray-800); font-size: clamp(1.2rem, 2.2vw, 1.6rem); line-height: 1.4; margin-top: 18px; max-width: 540px; }
.auth-points { display: grid; gap: 12px; list-style: none; margin-top: 26px; }
.auth-points li { align-items: center; color: var(--gray-700); display: flex; font-size: 1.06rem; gap: 12px; line-height: 1.45; }
.auth-tick { align-items: center; background: var(--secondary); border-radius: 50%; color: var(--white); display: inline-flex; flex: none; height: 28px; justify-content: center; width: 28px; }
.auth-tick svg { height: 15px; width: 15px; }

/* ---- The card ---- */
.auth-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  min-width: 0;
  padding: 28px 28px 24px;
}
.auth-icon {                     /* forgot password and "Check your email" */
  align-items: center;
  background: var(--portal-ok-bg);
  border-radius: 50%;
  color: var(--secondary);
  display: flex;
  height: 52px;
  justify-content: center;
  margin-bottom: 14px;
  width: 52px;
}
.auth-icon svg { height: 26px; width: 26px; }
.auth-icon.is-warn { background: rgba(200, 100, 10, 0.1); color: var(--primary-dark); }    /* a link that can't be used */
.auth-title { color: var(--gray-900); font-size: 1.65rem; font-weight: 800; line-height: 1.25; margin: 0; }
.auth-sub { color: var(--gray-600); font-size: 0.98rem; line-height: 1.5; margin: 6px 0 18px; }
.auth-body { color: var(--gray-800); line-height: 1.6; margin-bottom: 8px; }
.auth-gap { margin-top: 18px; }
.auth-card .portal-banner { margin-bottom: 14px; }
.auth-form .portal-field { margin-bottom: 14px; }
.auth-submit { font-size: 1.08rem; margin-top: 4px; min-height: 52px; }
.auth-forgot, .auth-link {
  align-items: center;
  color: var(--secondary);
  display: flex;
  font-weight: 700;
  justify-content: center;
  margin-top: 8px;
  min-height: 44px;
  text-align: center;            /* a long translation wraps, centred */
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-forgot:hover, .auth-link:hover { color: var(--secondary-dark); }
.auth-divider { border-top: 1px solid var(--gray-200); margin: 8px 0 14px; }
.auth-new { color: var(--gray-600); font-size: 0.95rem; line-height: 1.45; margin-bottom: 10px; text-align: center; }
.auth-create {
  align-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px rgba(200, 100, 10, 0.3);
  color: var(--white);
  display: flex;
  font-size: 1.05rem;
  font-weight: 700;
  justify-content: center;
  margin: 0 auto;
  max-width: 300px;
  min-height: 50px;
  padding: 10px 24px;
  text-align: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.auth-create:hover { box-shadow: 0 6px 18px rgba(200, 100, 10, 0.38); color: var(--white); transform: translateY(-1px); }
.auth-create:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 3px; }
.auth-alt {                      /* sign-up's "Sign in": quieter than the forest Create account button above it */
  align-items: center;
  border: 2px solid var(--secondary);
  border-radius: var(--radius-full);
  color: var(--secondary);
  display: flex;
  font-size: 1.05rem;
  font-weight: 700;
  justify-content: center;
  margin: 0 auto;
  max-width: 300px;
  min-height: 50px;
  padding: 10px 24px;
  text-align: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.auth-alt:hover { background: var(--portal-ok-bg); color: var(--secondary-dark); }
.auth-alt:focus-visible { outline: 3px solid var(--secondary); outline-offset: 3px; }

/* ---- Sign-up: a compact form in pairs (owner's choice of 2026-11-09), so a 600px card; the left half stays in view
   while it scrolls ---- */
.auth-page.is-long { justify-content: flex-start; }
.auth-wrap.is-long { align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 600px); max-width: 1180px; }
.auth-wrap.is-long .auth-brand { padding-top: 24px; position: sticky; top: calc(var(--header-h) + 40px); }
.auth-wrap.is-long .auth-card { padding: 30px 32px 26px; }

.auth-row { display: grid; gap: 0 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-row[hidden] { display: none; }
/* Each field in a pair is label, box, notes, sharing the pair's three rows, so the two boxes line up even when one
   label wraps (long in Tamil and Malayalam). Older browsers without subgrid just stack each field as before. */
@supports (grid-template-rows: subgrid) {
  .auth-row > .portal-field { display: grid; grid-row: span 3; grid-template-rows: subgrid; }
  .auth-row > .portal-field > .portal-label { align-self: end; }
}
.auth-note { margin: -4px 0 16px; }      /* the public-name note, under the State and district pair */
.auth-sr { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px; }

/* The account type: two options side by side; the chosen one is forest, with a tick */
.auth-type { border: 0; margin: 0 0 16px; min-width: 0; padding: 0; }
.auth-type-options { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-type-option { cursor: pointer; display: block; min-width: 0; position: relative; }
.auth-type-option input { height: 1px; margin: 0; opacity: 0; position: absolute; width: 1px; }
.auth-type-body {
  align-items: center;
  background: var(--cream);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  color: var(--gray-800);
  display: flex;
  font-weight: 700;
  gap: 10px;
  height: 100%;
  line-height: 1.3;
  min-height: 56px;
  padding: 10px 14px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.auth-type-icon { flex: none; font-size: 1.35rem; line-height: 1; }
.auth-type-name { flex: 1; min-width: 0; }
.auth-type-check { color: var(--secondary); display: none; flex: none; height: 18px; width: 18px; }
.auth-type-option:hover .auth-type-body { border-color: var(--gray-400); }
.auth-type-option input:checked + .auth-type-body { background: var(--portal-ok-bg); border-color: var(--secondary); color: var(--secondary-dark); }
.auth-type-option input:checked + .auth-type-body .auth-type-check { display: block; }
.auth-type-option input:focus-visible + .auth-type-body { outline: 2px solid var(--secondary); outline-offset: 3px; }
.auth-type-desc { margin-top: 8px; }

/* Password strength (saffron while short or weak, forest when good or strong) and the match line, js/signup.js */
.auth-meter { align-items: center; display: flex; gap: 10px; margin-top: 8px; }
.auth-meter[hidden], .auth-match[hidden] { display: none; }
.auth-meter-bars { display: grid; flex: none; gap: 4px; grid-template-columns: repeat(4, 16px); }
.auth-meter-bars i { background: var(--gray-200); border-radius: 3px; height: 6px; }
.auth-meter[data-level="1"] i:nth-child(1), .auth-meter[data-level="2"] i:nth-child(-n+2) { background: var(--primary); }
.auth-meter[data-level="3"] i:nth-child(-n+3) { background: var(--secondary-light); }
.auth-meter[data-level="4"] i { background: var(--secondary); }
.auth-meter-word { color: var(--primary-dark); font-size: 0.86rem; font-weight: 700; line-height: 1.4; min-width: 0; }
.auth-meter[data-level="3"] .auth-meter-word, .auth-meter[data-level="4"] .auth-meter-word { color: var(--secondary); }
.auth-match { color: var(--gray-600); font-size: 0.86rem; font-weight: 700; line-height: 1.5; margin-top: 6px; }   /* level with the hint beside it */
.auth-match.is-ok { color: var(--secondary); }
.auth-match-tick { display: inline-block; height: 14px; margin-right: 4px; vertical-align: -2px; width: 14px; }

/* ---- Sign-up below 1100px: the site above, the card below, because the pairs need the card's width ---- */
@media (max-width: 1099px) {
  .auth-page.is-long { padding: 32px 24px 48px; }
  .auth-wrap.is-long { gap: 24px; grid-template-columns: minmax(0, 1fr); justify-items: center; max-width: 600px; }
  .auth-wrap.is-long .auth-brand { padding-top: 0; position: static; text-align: center; }
  .auth-wrap.is-long .auth-logo { flex-direction: column; gap: 10px; }
  .auth-wrap.is-long .auth-logo .logo-icon { height: 56px; width: 56px; }
  .auth-wrap.is-long .auth-logo-name { font-size: 2rem; }
  .auth-wrap.is-long .auth-tagline { font-size: 1.12rem; margin: 10px auto 0; }
  .auth-wrap.is-long .auth-points { display: none; }
  .auth-wrap.is-long .auth-card { width: 100%; }
}

/* ---- Tablets and phones: the site above, the card below ---- */
@media (max-width: 900px) {
  .auth-page, .auth-page.is-long { justify-content: flex-start; min-height: 0; padding: 28px 16px 40px; }
  .auth-wrap { gap: 24px; grid-template-columns: minmax(0, 1fr); justify-items: center; max-width: 480px; }
  .auth-brand { text-align: center; }
  .auth-logo { flex-direction: column; gap: 10px; }
  .auth-logo .logo-icon { height: 56px; width: 56px; }
  .auth-logo-name { font-size: 2rem; }
  .auth-tagline { font-size: 1.12rem; margin: 10px auto 0; }
  .auth-points { display: none; }          /* the card comes first on a small screen */
  .auth-card, .auth-wrap.is-long .auth-card { padding: 22px 18px 20px; width: 100%; }
  .auth-title { font-size: 1.4rem; }
}

/* ---- Phones: sign-up's pairs become one column, then the two account types stack ---- */
@media (max-width: 560px) {
  .auth-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 400px) {
  .auth-type-options { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-create, .auth-alt, .auth-type-body { transition: none; }
  .auth-create:hover { transform: none; }
}
