/* Sign-up, login and "check your email" pages (views/register.ejs, login.ejs, check-email.ejs).
   Desktop: a brand panel beside the form. Phones and tablets: the form card only, full width.
   The pattern is pure CSS (no image files). Right-to-left works through logical properties. */

.auth-page { background: #f4f7f5; }

.auth-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}
@media (min-width: 992px) {
  .auth-wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

/* ---- brand panel (desktop only) ---- */
.auth-brand { display: none; }
@media (min-width: 992px) {
  .auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 3rem 3.5rem;
    color: #fff;
    background:
      radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .16) 1px, transparent 1.5px) 0 0 / 22px 22px,
      linear-gradient(150deg, #3db870 0%, #23935a 55%, #17704a 100%);
  }
  .auth-brand::before,
  .auth-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    pointer-events: none;
  }
  .auth-brand::before { width: 420px; height: 420px; inset-block-start: -140px; inset-inline-end: -160px; }
  .auth-brand::after { width: 300px; height: 300px; inset-block-end: -120px; inset-inline-start: -100px; }
}
.auth-brand-inner { position: relative; z-index: 1; max-width: 440px; }
.auth-brand h2 { font-size: 2rem; font-weight: 700; line-height: 1.25; margin-bottom: 1.75rem; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.auth-points li { display: flex; align-items: flex-start; gap: .85rem; font-size: 1.02rem; line-height: 1.45; }
.auth-points i {
  flex: 0 0 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .6rem;
  background: rgba(255, 255, 255, .16);
  font-size: .95rem;
}

/* ---- form side ---- */
.auth-main {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}
@media (min-width: 576px) { .auth-main { align-items: center; padding: 2.5rem 1.5rem; } }

.auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid #e5ece8;
  border-radius: 1.1rem;
  box-shadow: 0 10px 30px rgba(20, 60, 40, .07);
  padding: 2rem 1.5rem;
}
@media (min-width: 576px) { .auth-card { padding: 2.25rem 2.25rem; } }

.auth-title { font-size: 1.6rem; font-weight: 700; color: #16261d; margin: 0 0 .35rem; }
.auth-subtitle { color: #5f6f66; margin: 0 0 1.5rem; }

.auth-card .form-label { font-weight: 600; font-size: .9rem; color: #2b3a31; margin-bottom: .35rem; }
.auth-card .form-control,
.auth-card .form-select {
  min-height: 46px;
  border-radius: .65rem;
  border: 1.5px solid #dbe4de;
  font-size: 16px; /* below 16px iPhones zoom the page in on focus */
}
.auth-card .form-control:focus,
.auth-card .form-select:focus { border-color: #3db870; box-shadow: 0 0 0 .2rem rgba(61, 184, 112, .18); }

.auth-btn {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: .7rem;
  background: #2fa565;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  transition: background .15s, box-shadow .15s;
}
.auth-btn:hover, .auth-btn:focus { background: #23935a; color: #fff; box-shadow: 0 6px 16px rgba(35, 147, 90, .25); }

.auth-foot { text-align: center; margin: 1.25rem 0 0; color: #5f6f66; }
.auth-foot a { font-weight: 600; }

.auth-divider { border: 0; border-top: 1px solid #e8efea; margin: 1.5rem 0 1.25rem; }

/* ---- account type ---- */
.auth-roles { border: 0; margin: 0 0 1.25rem; padding: 0; }
.auth-roles legend { font-size: .9rem; font-weight: 600; color: #2b3a31; margin-bottom: .5rem; float: none; width: auto; }
.auth-role-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .65rem; }
.auth-role {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  margin: 0;
  padding: .9rem .9rem .85rem;
  border: 1.5px solid #dbe4de;
  border-radius: .8rem;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.auth-role:hover { border-color: #9fd9b6; }
.auth-role input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.auth-role-icon {
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .6rem;
  background: #eef7f1;
  color: #23935a;
}
.auth-role strong { font-size: .95rem; color: #16261d; line-height: 1.25; }
.auth-role small { color: #66756c; font-size: .8rem; line-height: 1.3; }
.auth-role.is-checked,
.auth-role:has(input:checked) { border-color: #2fa565; background: #f1faf4; box-shadow: 0 0 0 .2rem rgba(47, 165, 101, .14); }
.auth-role.is-checked .auth-role-icon,
.auth-role:has(input:checked) .auth-role-icon { background: #2fa565; color: #fff; }
.auth-role:has(input:focus-visible) { outline: 2px solid #23935a; outline-offset: 2px; }
@media (max-width: 359.98px) { .auth-role-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- password show / hide ---- */
.auth-pass { position: relative; }
.auth-pass .form-control { padding-inline-end: 3rem; }
.auth-pass-toggle {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 3rem;
  border: 0;
  background: transparent;
  color: #6b7a71;
}

/* ---- "did you mean" ---- */
.auth-suggest {
  margin-top: .5rem;
  padding: .6rem .75rem;
  border-radius: .6rem;
  background: #fff8e6;
  border: 1px solid #f3dfa6;
  font-size: .9rem;
  color: #5b4710;
}
.auth-suggest-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.auth-suggest-actions button {
  border: 1px solid #d9c27b;
  background: #fff;
  border-radius: 2rem;
  padding: .25rem .8rem;
  font-size: .85rem;
  color: #5b4710;
}
.auth-suggest-actions button.primary { background: #2fa565; border-color: #2fa565; color: #fff; }

/* ---- check your email ---- */
.auth-mail-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef7f1;
  color: #23935a;
  font-size: 1.6rem;
}
.auth-address { font-weight: 700; color: #16261d; word-break: break-all; }
.auth-tips { background: #f6f9f7; border-radius: .8rem; padding: .9rem 1rem; margin: 1.25rem 0; }
.auth-tips p { font-weight: 600; margin: 0 0 .4rem; color: #2b3a31; }
.auth-tips ul { margin: 0; padding-inline-start: 1.1rem; color: #4d5c53; }
.auth-secondary-btn {
  width: 100%;
  min-height: 46px;
  border-radius: .7rem;
  border: 1.5px solid #2fa565;
  background: #fff;
  color: #23935a;
  font-weight: 600;
}
.auth-secondary-btn:hover { background: #f1faf4; }
.auth-details summary { cursor: pointer; color: #23935a; font-weight: 600; font-size: .92rem; }
.auth-details[open] summary { margin-bottom: .75rem; }

/* one consent line under the sign-up button (replaces two checkboxes) */
.auth-consent { margin: .75rem 0 0; text-align: center; font-size: .8rem; line-height: 1.45; color: #6b7a71; }

/* Until an account type is picked, only the two cards show (script-driven; without JavaScript everything shows) */
.auth-role-hint { display: none; margin: .6rem 0 0; font-size: .85rem; color: #66756c; }
#registerForm.js.needs-role .auth-role-hint { display: block; }
#registerForm.js.needs-role #signupFields { display: none; }
#registerForm.js.needs-role .auth-role { border-color: #b9dcc6; }
