/* ============================================================
   Cloud PR Wire — account pages (signup.html / login.html)
   Email + password form with the math check at the bottom,
   plus the reveal state injected by js/cloud-auth.js.
   Loaded after cloudprwire.css (uses its --cpw-* tokens).
   ============================================================ */

.cpw-auth { padding: 90px 0 110px; background: var(--cpw-bg-soft); }
.cpw-auth-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 44px 44px 36px;
  background: #fff;
  border: 1px solid var(--cpw-line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 26, 87, .08);
}
.cpw-auth-head { text-align: center; margin-bottom: 30px; }
.cpw-auth-head h2 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  color: var(--cpw-navy);
}
.cpw-auth-head p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--cpw-muted); }

/* ---------- Fields ---------- */
.cpw-field { margin-bottom: 20px; }
.cpw-field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--cpw-navy);
}
.cpw-optional { font-size: 13px; font-weight: 600; color: var(--cpw-muted); }

.cpw-input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 16px;
  font-size: 16px;
  color: var(--cpw-ink);
  background: #fff;
  border: 1px solid #d5dbea;
  border-radius: 8px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.cpw-input::placeholder { color: #a3abbf; opacity: 1; }
.cpw-input:hover { border-color: #b9c3da; }
.cpw-input:focus { outline: none; border-color: var(--cpw-sky); box-shadow: var(--cpw-focus); }
.cpw-input[aria-invalid="true"] { border-color: var(--cpw-danger); }
.cpw-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(217, 48, 37, .2); }

.cpw-field__hint,
.cpw-field__error { margin: 7px 0 0; font-size: 13px; line-height: 1.5; }
.cpw-field__hint { color: var(--cpw-muted); }
.cpw-field__error { color: var(--cpw-danger); font-weight: 600; }

/* Password with show/hide toggle */
.cpw-password { position: relative; }
.cpw-password .cpw-input { padding-right: 54px; }
.cpw-password__toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 17px;
  color: var(--cpw-muted);
  background: transparent;
  border-radius: 0 7px 7px 0;
  transition: color .2s ease;
}
.cpw-password__toggle:hover { color: var(--cpw-navy); }
.cpw-password__toggle:focus-visible { outline: none; color: var(--cpw-navy); box-shadow: inset var(--cpw-focus); }

/* ---------- Math check (sits under the fields) ---------- */
.cpw-check {
  margin: 28px 0 0;
  padding: 18px 20px 20px;
  background: var(--cpw-bg-soft);
  border: 1px solid var(--cpw-line);
  border-radius: 10px;
}
.cpw-check .cpw-field__label { margin-bottom: 2px; }
.cpw-check__hint { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--cpw-muted); }
.cpw-check__row { display: flex; align-items: center; gap: 12px; }
.cpw-check__sum {
  flex: 0 0 auto;
  min-width: 92px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--cpw-navy);
  white-space: nowrap;
  user-select: none;
}
.cpw-check__refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  font-size: 14px;
  color: var(--cpw-sky-dark);
  background: #fff;
  border: 1px solid var(--cpw-line);
  border-radius: 50%;
  transition: background-color .2s ease, color .2s ease;
}
.cpw-check__refresh:hover { color: #fff; background: var(--cpw-sky); }
.cpw-check__refresh:focus-visible { outline: none; box-shadow: var(--cpw-focus); }
.cpw-check__row .cpw-input { flex: 1 1 auto; min-width: 0; text-align: center; }

/* ---------- Submit + alternate link ---------- */
.cpw-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 24px;
  padding: 15px 22px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--cpw-navy);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .2s ease;
}
.cpw-btn:hover { background: var(--cpw-navy-dark); }
.cpw-btn:focus-visible { outline: none; box-shadow: var(--cpw-focus); }
.cpw-auth-alt { margin: 20px 0 0; text-align: center; font-size: 15px; color: var(--cpw-muted); }
.cpw-auth-alt a { display: inline; font-weight: 700; color: var(--cpw-sky-dark); }
.cpw-auth-alt a:hover { text-decoration: underline; }
.cpw-auth-alt a:focus-visible { outline: 2px solid var(--cpw-sky); outline-offset: 2px; border-radius: 2px; }

/* ---------- Reveal state (decoded only after a valid submit) ---------- */
.cpw-reveal-inner { padding: 6px 4px 4px; text-align: center; }
.cpw-reveal-inner h3:focus { outline: none; }
.cpw-badge {
  display: inline-block;
  margin-bottom: 20px;
  padding: 7px 15px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--cpw-sky-dark);
  background: #e8f3ff;
  border-radius: 30px;
}
.cpw-reveal-inner h3 {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--cpw-navy);
}
.cpw-reveal-inner p {
  max-width: 430px;
  margin: 0 auto 26px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--cpw-body);
}
.cpw-reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  font-size: 16px;
  font-weight: 700;
  color: #fff !important;
  background: var(--cpw-sky);
  border-radius: 8px;
  transition: background-color .25s ease;
}
.cpw-reveal-btn:hover { color: #fff !important; background: var(--cpw-sky-dark); }
.cpw-reveal-btn:focus-visible { outline: none; box-shadow: var(--cpw-focus); }
.cpw-redirect-note { margin: 18px 0 0; font-size: 13px; color: #9aa3b8; }

@media (max-width: 575px) {
  .cpw-auth { padding: 60px 0 80px; }
  .cpw-auth-card { padding: 34px 22px 28px; }
  .cpw-auth-head h2 { font-size: 24px; }
  .cpw-check { padding: 16px 14px 16px; }
  .cpw-check__row { gap: 8px; }
  .cpw-check__sum { min-width: 0; font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .cpw-input, .cpw-password__toggle, .cpw-check__refresh, .cpw-btn, .cpw-reveal-btn { transition: none; }
}
