/* ═══════════════════════════════════════════════════════════════════════════
   DreamPage sign-in card.

   Loaded only on the logged-out account page (see inc/account.php), so none of
   this can reach the dashboard, cart or checkout. The dp-login namespace is
   deliberately separate from the older .dp-account-* gate styles in site.css,
   which still dress the lost-password screen.

   One column, one card, one job. Mobile-first.
   ═══════════════════════════════════════════════════════════════════════════ */

.dp-login {
  --dp-login-radius: 26px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

/* ── The card ────────────────────────────────────────────────────────────── */
.dp-login__card {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 5vw, 38px) clamp(20px, 4.5vw, 36px) clamp(22px, 4vw, 30px);
  border: 1px solid rgba(19, 36, 64, 0.09);
  border-radius: var(--dp-login-radius);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(106, 90, 224, 0.09) 0%, rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, #ffffff 0%, rgba(249, 247, 255, 0.98) 100%);
  box-shadow: 0 24px 60px rgba(36, 24, 88, 0.1);
}

/* ── Head ────────────────────────────────────────────────────────────────── */
.dp-login__head {
  margin: 0 0 22px;
  text-align: center;
}

.dp-login__logo {
  display: block;
  width: auto;
  max-width: min(160px, 48vw);
  max-height: 46px;
  height: auto;
  margin: 0 auto 14px;
}

.dp-login__wordmark {
  display: block;
  margin: 0 0 16px;
  font-family: "Poppins", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--dp-text);
}

.dp-login__wordmark span {
  color: var(--dp-accent);
}

.dp-login__title {
  margin: 0 0 6px;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.65rem, 5vw, 2.05rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--dp-text);
}

.dp-login__sub {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--dp-text-soft);
}

/* ── Method switcher ─────────────────────────────────────────────────────── */
.dp-login__methods {
  display: none;
  gap: 4px;
  margin: 0 0 22px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(19, 36, 64, 0.05);
}

.dp-login.is-enhanced .dp-login__methods {
  display: flex;
}

.dp-login__method {
  flex: 1 1 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dp-text-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.dp-login__method:hover {
  color: var(--dp-text);
}

.dp-login__method.is-active {
  background: #ffffff;
  color: var(--dp-text);
  box-shadow: 0 4px 14px rgba(19, 36, 64, 0.09);
}

/* ── Steps ───────────────────────────────────────────────────────────────── */
/* Without JS only the classic WooCommerce form is shown; the inline script at
   the end of the template adds .is-enhanced and the stepped flow takes over. */
.dp-login [data-step] {
  display: none;
  margin: 0;
}

.dp-login [data-step="classic"] {
  display: grid;
  gap: 16px;
}

.dp-login.is-enhanced [data-step="classic"] {
  display: none;
}

.dp-login.is-enhanced [data-step].is-active {
  display: grid;
  gap: 16px;
  animation: dp-login-in 0.28s ease both;
}

@keyframes dp-login-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dp-login.is-enhanced [data-step].is-active {
    animation: none;
  }
}

/* ── Fields ──────────────────────────────────────────────────────────────── */
.dp-login .dp-field {
  display: grid;
  gap: 7px;
  margin: 0;
}

.dp-login .dp-field label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(19, 36, 64, 0.6);
}

.dp-login .dp-input {
  width: 100%;
  box-sizing: border-box;
  padding: 15px 16px;
  border: 1px solid rgba(19, 36, 64, 0.16);
  border-radius: 14px;
  background: #ffffff;
  font: inherit;
  font-size: 1rem;
  color: var(--dp-text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.dp-login .dp-input::placeholder {
  color: rgba(19, 36, 64, 0.34);
}

.dp-login .dp-input:focus {
  outline: none;
  border-color: var(--dp-accent);
  box-shadow: 0 0 0 4px rgba(106, 90, 224, 0.16);
}

.dp-login .dp-input--code {
  padding: 16px;
  font-family: "Poppins", sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.42em;
  text-align: center;
  text-indent: 0.42em; /* centres the tracked text instead of leaving it right-heavy */
}

.dp-login .dp-input-wrap {
  position: relative;
}

.dp-login .dp-input-wrap .dp-input {
  padding-right: 48px;
}

.dp-login .dp-input-reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  display: flex;
  padding: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(19, 36, 64, 0.45);
  cursor: pointer;
  transform: translateY(-50%);
}

.dp-login .dp-input-reveal:hover {
  color: var(--dp-accent);
}

.dp-login .dp-field__help {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--dp-text-muted);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.dp-login .dp-login__submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--dp-accent) 0%, var(--dp-accent-strong) 100%);
  box-shadow: 0 14px 30px rgba(91, 63, 214, 0.28);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.dp-login .dp-login__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(91, 63, 214, 0.34);
}

.dp-login .dp-login__submit:active {
  transform: none;
}

.dp-login .dp-login__submit[disabled],
.dp-login .dp-login__submit.is-busy {
  cursor: progress;
  opacity: 0.72;
  transform: none;
  box-shadow: 0 10px 22px rgba(91, 63, 214, 0.2);
}

.dp-login .dp-login__submit--ghost {
  background: #ffffff;
  border: 1.5px solid var(--dp-accent);
  box-shadow: none;
  color: var(--dp-accent);
}

.dp-login .dp-login__submit--ghost:hover {
  box-shadow: 0 12px 26px rgba(91, 63, 214, 0.14);
}

.dp-login__spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: dp-login-spin 0.7s linear infinite;
}

.dp-login__submit.is-busy .dp-login__spinner {
  display: block;
}

@keyframes dp-login-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Secondary actions ───────────────────────────────────────────────────── */
.dp-login__alt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  margin: 0;
  text-align: center;
}

.dp-login .dp-login__link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dp-accent);
  text-decoration: none;
  cursor: pointer;
}

.dp-login .dp-login__link:hover {
  text-decoration: underline;
}

.dp-login .dp-login__link[disabled] {
  color: var(--dp-text-muted);
  cursor: default;
  text-decoration: none;
}

.dp-login .dp-login__link--quiet {
  font-weight: 500;
  color: var(--dp-text-muted);
}

.dp-login .dp-login__back {
  justify-self: center;
  padding: 4px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.85rem;
  color: var(--dp-text-muted);
  cursor: pointer;
}

.dp-login .dp-login__back:hover {
  color: var(--dp-text);
}

.dp-login__aside {
  margin: 0;
  font-size: 0.9rem;
  text-align: center;
}

.dp-login__aside a {
  color: var(--dp-accent);
  font-weight: 600;
  text-decoration: none;
}

.dp-login__remember {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--dp-text-soft);
}

.dp-login__remember input {
  width: 17px;
  height: 17px;
  accent-color: var(--dp-accent);
}

/* ── Identity line + messages ────────────────────────────────────────────── */
.dp-login__identity {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(106, 90, 224, 0.18);
  border-radius: 14px;
  background: rgba(106, 90, 224, 0.06);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--dp-text-soft);
}

.dp-login__identity strong {
  color: var(--dp-text);
  font-weight: 600;
  word-break: break-word;
}

.dp-login__error {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(214, 61, 74, 0.24);
  border-radius: 14px;
  background: rgba(214, 61, 74, 0.07);
  font-size: 0.9rem;
  line-height: 1.5;
  color: #a8202c;
}

.dp-login__error--ok {
  border-color: rgba(38, 150, 96, 0.26);
  background: rgba(38, 150, 96, 0.08);
  color: #1c6b45;
}

/* ── Trust strip ─────────────────────────────────────────────────────────── */
.dp-login__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 24px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(19, 36, 64, 0.08);
  list-style: none;
}

.dp-login__trust li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--dp-text-muted);
}

.dp-login__trust svg {
  color: var(--dp-accent);
}

/* ── Registration disclosure ─────────────────────────────────────────────── */
.dp-login__register {
  margin: 18px 0 0;
  padding: 4px 6px;
  text-align: center;
}

.dp-login__register > summary {
  display: inline-block;
  padding: 8px 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dp-accent);
  cursor: pointer;
  list-style: none;
}

.dp-login__register > summary::-webkit-details-marker {
  display: none;
}

.dp-login__register-note {
  margin: 4px 0 16px;
  font-size: 0.87rem;
  line-height: 1.55;
  color: var(--dp-text-muted);
}

.dp-login__register form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.dp-login__register .woocommerce-privacy-policy-text {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--dp-text-muted);
}

/* ── Post-login password overlay ─────────────────────────────────────────── */
.dp-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.dp-login-overlay[hidden] {
  display: none;
}

.dp-login-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 20, 40, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: dp-login-fade 0.25s ease both;
}

.dp-login-overlay__dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: clamp(26px, 5vw, 34px);
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 40px 90px rgba(13, 20, 40, 0.36);
  text-align: center;
  animation: dp-login-pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}

@keyframes dp-login-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes dp-login-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dp-login-overlay__backdrop,
  .dp-login-overlay__dialog {
    animation: none;
  }
}

.dp-login-overlay__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 0 14px;
  border-radius: 50%;
  background: rgba(38, 150, 96, 0.12);
  color: #24955f;
}

.dp-login-overlay__dialog h2 {
  margin: 0 0 8px;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.4rem, 4.4vw, 1.7rem);
  line-height: 1.18;
  color: var(--dp-text);
}

.dp-login-overlay__sub {
  margin: 0 0 22px;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--dp-text-soft);
}

.dp-login-overlay__form {
  display: grid;
  gap: 16px;
  text-align: left;
}

.dp-login-overlay__form .dp-login__link--quiet {
  justify-self: center;
}

/* ── Page chrome ─────────────────────────────────────────────────────────── */
/* The card carries its own heading, so the generic page hero above it would
   only repeat itself. page.php drops the hero; this keeps the spacing sane. */
body.woocommerce-account:not(.logged-in) .dp-page-article--account {
  padding-top: clamp(8px, 3vw, 24px);
}
