/* Auth pages — login, signup, password and verification flows. Loaded by
 * the portal layout whenever the minimal auth shell renders, on top of
 * customer-portal.css.
 *
 * Dark/purple treatment matching the app's own auth screens: a card floating
 * on the near-black page background, two slow-drifting colour glows behind
 * the header and card (see .auth-glow-a/-b, copied from the app's own
 * App/www/css/app.css), solid-purple badge and button. */

:root {
  --auth-bg: #0E0E10;
  --auth-ink: #F2F2F4;
  --auth-muted: #8E8E93;
  --auth-border: #232326;
  --auth-field-bg: #0E0E10;
  --auth-field-border: #2C2C2E;
  --auth-purple: #9B6DFF;
  --auth-purple-press: #7C4FE0;
  --auth-error: #F0A29B;
  --auth-ok: #C9B6FF;
}

body,
.cportal-body {
  background: var(--auth-bg);
  color: var(--auth-ink);
}

/* customer-portal.css scopes the auth shell to a narrow centered column and
 * pads/centers the minimal body for its old single-card layout; this page now
 * has its own full-bleed header + glow background, so those get reset here. */
.cportal-body-minimal {
  padding: 0;
  align-items: stretch;
  justify-content: flex-start;
}

.cportal-auth-shell {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Two drifting colour glows behind the whole page, including the header. */
.auth-glow {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(58px);
  pointer-events: none;
}
.auth-glow-a {
  width: 330px;
  height: 330px;
  left: -110px;
  top: -70px;
  background: radial-gradient(circle, rgba(155, 109, 255, .34), transparent 70%);
  animation: auth-drift 9s ease-in-out infinite alternate;
}
.auth-glow-b {
  width: 300px;
  height: 300px;
  right: -100px;
  bottom: -60px;
  background: radial-gradient(circle, rgba(240, 62, 62, .16), transparent 70%);
  animation: auth-drift 12s ease-in-out infinite alternate-reverse;
}
@keyframes auth-drift {
  to { transform: translate(34px, 26px) scale(1.1); }
}

.cportal-auth-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1160px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 20px 24px;
}
.cportal-auth-header > .brand-logo { margin: 0; }
.cportal-auth-back {
  display: inline-block;
  background: #1C1C1F;
  border: 1px solid #2C2C2E;
  color: var(--auth-ink);
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
}
.cportal-auth-back:hover { border-color: var(--auth-purple); color: var(--auth-ink); }

.cportal-main-minimal {
  position: relative;
  z-index: 1;
  width: 100%;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px 64px;
  box-sizing: border-box;
}

.cportal-auth-card {
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 40px;
  border-radius: 16px;
  background: #1C1C1F;
  border: 1px solid var(--auth-border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}

.cportal-auth-card h1 {
  margin: 0 0 6px;
  text-align: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--auth-ink);
}

.cportal-auth-card .cportal-muted {
  text-align: center;
  color: var(--auth-muted);
  font-size: 15px;
  margin: 0 0 28px;
}

.cportal-auth-card .cportal-form label {
  display: block;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-muted);
}

.cportal-auth-card .cportal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cportal-auth-card .cportal-form input,
.cportal-auth-card .cportal-form select,
.cportal-auth-card .cportal-form textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 13px 16px;
  border: 1px solid var(--auth-field-border);
  border-radius: 12px;
  background: var(--auth-field-bg);
  color: var(--auth-ink);
  font-size: 15px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.cportal-auth-card .cportal-form input:focus,
.cportal-auth-card .cportal-form select:focus,
.cportal-auth-card .cportal-form textarea:focus {
  outline: none;
  border-color: var(--auth-purple);
  box-shadow: 0 0 0 3px rgba(155, 109, 255, .25);
}

.cportal-auth-card .cportal-form input::placeholder { color: #6E6E73; }
.cportal-auth-card .cportal-form input[readonly] { background: #1A1A1D; border-color: var(--auth-border); color: var(--auth-muted); }

.cportal-hint { color: #6E6E73; font-size: 12px; margin: -4px 0 0; }

/* Primary action: solid purple pill with the app's glow shadow. */
.cportal-btn-primary,
.cportal-auth-card .cportal-btn-primary {
  display: block;
  width: 100%;
  margin-top: 0;
  padding: 14px;
  border: 0;
  border-radius: 999px;
  background: var(--auth-purple);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(155, 109, 255, .3);
  transition: box-shadow .12s ease, transform .12s ease, background .12s ease;
}

.cportal-btn-primary:hover { background: var(--auth-purple-press); }

.cportal-btn-primary:active { transform: scale(.98); }

.cportal-btn-primary:disabled { opacity: .55; cursor: default; box-shadow: none; transform: none; }

/* Secondary actions read as plain text links. */
.cportal-auth-card .cportal-btn:not(.cportal-btn-primary) {
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--auth-purple);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  padding: 10px 0;
}

.cportal-auth-card .cportal-btn:not(.cportal-btn-primary):hover { color: var(--auth-ok); }

.cportal-auth-forgot {
  margin: -6px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--auth-muted);
}

.cportal-auth-forgot a,
.cportal-auth-foot a,
.cportal-auth-foot .cportal-link-button {
  color: var(--auth-purple);
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.cportal-auth-forgot a:hover,
.cportal-auth-foot a:hover { color: var(--auth-ok); text-decoration: none; }

.cportal-auth-foot {
  margin: 24px 0 0;
  text-align: center;
  color: var(--auth-muted);
  font-size: 14px;
}

.cportal-error {
  color: var(--auth-error);
  font-weight: 600;
  text-align: center;
  font-size: 14px;
}

.cportal-success,
.cportal-flash {
  color: var(--auth-ok);
  font-weight: 600;
  text-align: center;
  font-size: 14px;
  background: none;
  border: 0;
  box-shadow: none;
}

/* Cloudflare won't let a custom theme darken the widget's own card fully
 * (it's locked inside a closed shadow root — theme:'dark' only gets us so
 * far), so it's framed like a deliberately-embedded panel instead of a
 * floating mismatched box. */
.cf-turnstile-frame {
  margin: 16px auto 0;
  padding: 10px;
  display: flex;
  justify-content: center;
  background: var(--auth-field-bg);
  border: 1px solid var(--auth-field-border);
  border-radius: 12px;
}
.cf-turnstile { display: flex; justify-content: center; }

/* ToS/Privacy + 18+ signup checkboxes — the generic .cportal-form label rule
 * above is styled for field labels (block, bold, uppercase-ish colour), so
 * override it here for a plain inline toggle + sentence instead. */
.cportal-auth-card .cportal-form label.cportal-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--auth-muted);
}
/* A real checkbox underneath (semantics/keyboard/form-submit all unchanged),
 * styled as an iOS-style toggle track + thumb instead of a tickbox. */
.cportal-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 40px;
  height: 24px;
  margin: 1px 0 0;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: var(--auth-field-border);
  cursor: pointer;
  transition: background .18s ease;
}
.cportal-checkbox input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: transform .18s ease;
}
.cportal-checkbox input[type="checkbox"]:checked { background: var(--auth-purple); }
.cportal-checkbox input[type="checkbox"]:checked::before { transform: translateX(16px); }
.cportal-checkbox input[type="checkbox"]:focus-visible { outline: 2px solid var(--auth-purple); outline-offset: 2px; }
.cportal-checkbox a { color: var(--auth-purple); font-weight: 600; text-decoration: none; }
.cportal-checkbox a:hover { color: var(--auth-ok); }

/* Required-field marker — a plain asterisk after the label text. */
.cportal-required { color: var(--auth-error); margin-left: 2px; }

/* Town/city suggestion chips under the signup postcode field — a postcode
 * doesn't always map to one obvious name, so offer a few picks instead of
 * silently locking in whatever the geocoder resolved first. */
.cportal-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.cportal-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--auth-field-border);
  background: var(--auth-field-bg);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--auth-ink);
  cursor: pointer;
}
.cportal-chip:hover { border-color: var(--auth-purple); }
.cportal-chip.is-on { background: var(--auth-purple); border-color: var(--auth-purple); color: #fff; }
