/**
 * Psyrup — wp-login.php & WooCommerce account login gate
 */

/* ── wp-login.php base ───────────────────────────────────── */
body.login {
  background: var(--psyrup-warm-white, #fdfaf5);
  font-family: var(--font-body, 'DM Sans', Helvetica, sans-serif);
  color: var(--psyrup-charcoal, #2c2420);
}

body.login #login {
  width: min(100%, 26rem);
  padding: 2rem 1.25rem 2.5rem;
}

body.login #login > h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.login .psyrup-login-logo-wrap {
  text-align: center;
  margin-bottom: 1rem;
}

body.login .psyrup-login-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--psyrup-charcoal, #2c2420);
}

body.login .psyrup-login-logo__name {
  font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

body.login .psyrup-login-logo__ring {
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid var(--psyrup-amber, #c8873a);
  border-radius: 50%;
  background: rgba(200, 135, 58, 0.1);
  animation: psyrup-gate-breathe 8s ease-in-out infinite;
}

body.login #loginform,
body.login #registerform,
body.login #lostpasswordform,
body.login .privacy-policy-page-link {
  border: 1px solid rgba(107, 83, 68, 0.14);
  border-radius: var(--radius-lg, 24px);
  box-shadow: var(--shadow-md, 0 6px 24px rgba(44, 36, 32, 0.12));
  background: #fff;
}

body.login form {
  padding: 1.75rem 1.5rem 1.5rem;
  margin-top: 0;
}

body.login form .input,
body.login input[type='text'],
body.login input[type='password'],
body.login input[type='email'] {
  border: 1.5px solid rgba(107, 83, 68, 0.22);
  border-radius: var(--radius-md, 12px);
  font-size: 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--psyrup-warm-white, #fdfaf5);
  box-shadow: none;
}

body.login form .input:focus,
body.login input[type='text']:focus,
body.login input[type='password']:focus,
body.login input[type='email']:focus {
  border-color: var(--psyrup-amber, #c8873a);
  box-shadow: 0 0 0 3px rgba(200, 135, 58, 0.18);
  outline: none;
}

body.login label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--psyrup-mid, #5c4a3a);
}

body.login .button-primary,
body.login .button.button-large {
  width: 100%;
  min-height: 2.75rem;
  border: none;
  border-radius: var(--radius-pill, 999px);
  background: var(--psyrup-amber, #c8873a) !important;
  box-shadow: var(--shadow-amber, 0 4px 20px rgba(200, 135, 58, 0.25));
  font-weight: 500;
  letter-spacing: 0.04em;
  text-shadow: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

body.login .button-primary:hover,
body.login .button-primary:focus {
  background: var(--psyrup-amber-deep, #a3672a) !important;
  transform: translateY(-1px);
}

body.login #nav a,
body.login #backtoblog a {
  color: var(--psyrup-amber, #c8873a);
}

body.login #nav a:hover,
body.login #backtoblog a:hover {
  color: var(--psyrup-amber-deep, #a3672a);
}

body.login .message,
body.login .success,
body.login #login_error {
  border-radius: var(--radius-md, 12px);
  border-left-width: 3px;
}

body.login.psyrup-login--gated #loginform,
body.login.psyrup-login--gated #registerform,
body.login.psyrup-login--gated #lostpasswordform {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
  border: none;
  box-shadow: none;
}

body.login.psyrup-login--verified #loginform,
body.login.psyrup-login--verified #registerform,
body.login.psyrup-login--verified #lostpasswordform {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  max-height: none;
  transition: opacity 0.45s var(--ease-settle, cubic-bezier(0.22, 1, 0.36, 1));
}

/* ── Human verification gate (login + my-account) ───────── */
.psyrup-login-gate {
  position: relative;
  z-index: 2;
  margin: 0 auto 1rem;
  max-width: 22rem;
}

body.login .psyrup-login-gate {
  margin-bottom: 0.5rem;
}

.psyrup-login-gate__panel {
  background: #fff;
  border: 1px solid rgba(107, 83, 68, 0.14);
  border-radius: var(--radius-lg, 24px);
  box-shadow: var(--shadow-md, 0 6px 24px rgba(44, 36, 32, 0.12));
  padding: 1.35rem 1.25rem 1.15rem;
}

.psyrup-login-gate__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
  min-height: 7.5rem;
  justify-content: center;
}

.psyrup-login-gate__ring {
  width: 3.25rem;
  height: 3.25rem;
  border: 2px solid var(--psyrup-amber, #c8873a);
  border-radius: 50%;
  background: rgba(200, 135, 58, 0.1);
  animation: psyrup-gate-breathe 8s ease-in-out infinite;
}

.psyrup-login-gate__status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--psyrup-mid, #5c4a3a);
}

.psyrup-login-gate__progress {
  width: 100%;
  max-width: 12rem;
  height: 3px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(107, 83, 68, 0.12);
  overflow: hidden;
}

.psyrup-login-gate__progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--psyrup-amber-light, #e4aa6a), var(--psyrup-amber, #c8873a));
  transition: width 0.15s linear;
}

.psyrup-login-gate__captcha {
  display: none;
}

.psyrup-login-gate.is-captcha .psyrup-login-gate__loading {
  display: none;
}

.psyrup-login-gate.is-captcha .psyrup-login-gate__captcha {
  display: block;
}

.psyrup-login-gate.is-done {
  display: none;
}

.psyrup-gate-captcha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(107, 83, 68, 0.18);
  border-radius: var(--radius-md, 12px);
  background: var(--psyrup-cream, #f7f2ea);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.psyrup-gate-captcha:hover {
  border-color: rgba(200, 135, 58, 0.45);
}

.psyrup-gate-captcha.is-checking {
  pointer-events: none;
  opacity: 0.85;
}

.psyrup-gate-captcha.is-verified {
  border-color: var(--psyrup-sage, #7a9e7e);
  background: rgba(122, 158, 126, 0.08);
  cursor: default;
}

.psyrup-gate-captcha__check {
  position: relative;
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid rgba(107, 83, 68, 0.35);
  border-radius: 3px;
  background: #fff;
}

.psyrup-gate-captcha__check input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.psyrup-gate-captcha__mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: var(--psyrup-sage, #7a9e7e);
  font-size: 0.95rem;
  font-weight: 700;
  transition: opacity 0.2s ease;
}

.psyrup-gate-captcha.is-verified .psyrup-gate-captcha__check {
  border-color: var(--psyrup-sage, #7a9e7e);
  background: #fff;
}

.psyrup-gate-captcha.is-verified .psyrup-gate-captcha__mark {
  opacity: 1;
}

.psyrup-gate-captcha__label {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--psyrup-charcoal, #2c2420);
}

.psyrup-gate-captcha__badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-size: 0.62rem;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--psyrup-earth-light, #9c7b66);
}

.psyrup-gate-captcha__badge strong {
  font-size: 0.68rem;
  color: var(--psyrup-amber, #c8873a);
  letter-spacing: 0.08em;
}

.psyrup-gate-captcha__spinner {
  display: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(200, 135, 58, 0.25);
  border-top-color: var(--psyrup-amber, #c8873a);
  border-radius: 50%;
  animation: psyrup-gate-spin 0.7s linear infinite;
}

.psyrup-gate-captcha.is-checking .psyrup-gate-captcha__spinner {
  display: block;
}

.psyrup-gate-captcha.is-checking .psyrup-gate-captcha__check {
  border-color: transparent;
  background: transparent;
}

.psyrup-gate-captcha.is-checking .psyrup-gate-captcha__check input {
  pointer-events: none;
}

.psyrup-login-gate__fine {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: center;
  color: var(--psyrup-earth-light, #9c7b66);
}

/* Honeypot — must stay off-screen */
.psyrup-login-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── WooCommerce my-account login ─────────────────────────── */
.woocommerce-account.psyrup-account--gated #customer_login .u-column1 form.login,
.woocommerce-account.psyrup-account--gated #customer_login .u-column2 form.register {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: none;
}

.woocommerce-account.psyrup-account--verified #customer_login .u-column1 form.login,
.woocommerce-account.psyrup-account--verified #customer_login .u-column2 form.register {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  max-height: none;
  transition: opacity 0.45s ease;
}

.woocommerce-account .psyrup-login-gate {
  max-width: 100%;
  margin-bottom: 1.25rem;
}

@keyframes psyrup-gate-breathe {
  0%, 100% {
    transform: scale(0.28);
    opacity: 0.78;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes psyrup-gate-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .psyrup-login-gate__ring,
  body.login .psyrup-login-logo__ring {
    animation: none;
    transform: scale(0.65);
    opacity: 0.85;
  }

  .psyrup-gate-captcha__spinner {
    animation: none;
  }
}
