/* Inline auth modal — standalone version loaded on every non-calf-journal
   page for guests. Intercepts Impreza's ush_popup login with our own UI so
   the register/login flow is identical site-wide and inside the PWA. */

.cj-auth-modal[hidden] { display: none !important; }

.cj-auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 34, 28, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 99999;
  animation: cjAuthFadeIn 0.18s ease;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@keyframes cjAuthFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cj-auth-modal__card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cjAuthSlideIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cjAuthSlideIn {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.cj-auth-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(44, 74, 46, 0.1);
}

.cj-auth-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c4a2e;
}

.cj-auth-modal__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6b6a5c;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}
.cj-auth-modal__close:hover {
  background: rgba(44, 74, 46, 0.08);
  color: #2c4a2e;
}

.cj-auth-modal__tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid rgba(44, 74, 46, 0.1);
}
.cj-auth-modal__tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 12px 4px;
  margin-right: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #6b6a5c;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}
.cj-auth-modal__tab.is-active {
  color: #2c4a2e;
  border-bottom-color: #2c4a2e;
}

.cj-auth-modal__body {
  padding: 18px 20px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cj-auth-modal__field {
  display: block;
  margin-bottom: 14px;
}
.cj-auth-modal__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #2b2a26;
  margin-bottom: 6px;
}
.cj-auth-modal__input {
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  background: #fafaf7;
  border: 1px solid rgba(44, 74, 46, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  line-height: 1.2;
  color: #2b2a26;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-family: inherit;
}
.cj-auth-modal__input:focus {
  outline: none;
  border-color: #2c4a2e;
  background: #ffffff;
}
.cj-auth-modal__input::placeholder {
  color: #a3a296;
}
.cj-auth-modal__hint {
  margin: -6px 0 10px;
  font-size: 0.78rem;
  color: #6b6a5c;
  line-height: 1.35;
}
.cj-auth-modal__error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdecea;
  border: 1px solid rgba(204, 51, 51, 0.2);
  color: #9b2828;
  font-size: 0.85rem;
  line-height: 1.4;
}
.cj-auth-modal__success {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e8f5ec;
  border: 1px solid rgba(44, 74, 46, 0.2);
  color: #1f3421;
  font-size: 0.88rem;
  line-height: 1.4;
}
.cj-auth-modal__submit {
  width: 100%;
  appearance: none;
  border: 0;
  background: #2c4a2e;
  color: #ffffff;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}
.cj-auth-modal__submit:hover:not(:disabled) {
  background: #1f3421;
}
.cj-auth-modal__submit:active:not(:disabled) {
  transform: translateY(1px);
}
.cj-auth-modal__submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cj-auth-modal__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: cjAuthSpin 0.7s linear infinite;
}
@keyframes cjAuthSpin {
  to { transform: rotate(360deg); }
}
.cj-auth-modal__footer {
  margin-top: 14px;
  font-size: 0.82rem;
  color: #6b6a5c;
  line-height: 1.45;
  text-align: center;
}
.cj-auth-modal__footer a {
  color: #2c4a2e;
  text-decoration: underline;
  cursor: pointer;
}

.cj-auth-modal__show-pwd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  background: transparent;
  border: 0;
  color: #6b6a5c;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
}
.cj-auth-modal__input-wrap {
  position: relative;
}
.cj-auth-modal__input-wrap .cj-auth-modal__input {
  padding-right: 58px;
}

/* Lock body scroll while modal is open. */
html.cj-auth-open,
body.cj-auth-open {
  overflow: hidden;
}
