.chancay-login-modal {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.chancay-login-modal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.chancay-login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.chancay-login-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(92vh, 640px);
  overflow-y: auto;
  background: #fff;
  color: #0f172a;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.chancay-login-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.chancay-login-modal__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.chancay-login-modal__close i {
  font-size: 16px;
  line-height: 1;
}

.chancay-login-modal__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 36px 28px 28px;
}

.chancay-login-modal__logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(217, 4, 41, 0.18);
}

.chancay-login-modal__title {
  margin: 0;
  font-family: var(--cp-font, 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
}

.chancay-login-modal__text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #64748b;
  max-width: 34ch;
}

.chancay-login-modal__form {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 2px;
  text-align: left;
}

.chancay-login-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chancay-login-modal__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.chancay-login-modal__input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 0.9375rem;
  line-height: 1.2;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chancay-login-modal__input:focus {
  outline: none;
  border-color: var(--cp-primary, #d90429);
  box-shadow: 0 0 0 3px rgba(217, 4, 41, 0.12);
}

.chancay-login-modal__password-wrap {
  position: relative;
}

.chancay-login-modal__password-wrap .chancay-login-modal__input {
  padding-right: 44px;
}

.chancay-login-modal__toggle-pass {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.chancay-login-modal__toggle-pass:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.chancay-login-modal__error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.chancay-login-modal__error[hidden] {
  display: none !important;
}

.chancay-login-modal__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  padding: 0 20px;
  border: none;
  border-radius: 999px;
  background: var(--cp-primary, #d90429);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(217, 4, 41, 0.24);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.chancay-login-modal__submit:hover:not(:disabled) {
  background: var(--cp-primary-container, #ea1d2c);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(217, 4, 41, 0.28);
}

.chancay-login-modal__submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.chancay-login-modal__forgot {
  align-self: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
}

.chancay-login-modal__forgot:hover {
  color: var(--cp-primary, #d90429);
  text-decoration: underline;
}

.chancay-login-modal__divider {
  width: 100%;
  max-width: 340px;
  margin: 2px 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: #94a3b8;
}

.chancay-login-modal__google {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 340px;
  min-height: 44px;
}

.chancay-login-modal__google > div,
.chancay-login-modal__google iframe {
  border-radius: 999px !important;
}

.chancay-login-modal__register {
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: #64748b;
}

.chancay-login-modal__register a {
  color: var(--cp-primary, #d90429);
  font-weight: 700;
  text-decoration: none;
}

.chancay-login-modal__register a:hover {
  text-decoration: underline;
}

body.chancay-login-modal-open {
  overflow: hidden;
}

body.home-theme-dark .chancay-login-modal__panel {
  background: #1e293b;
  color: #f8fafc;
}

body.home-theme-dark .chancay-login-modal__title {
  color: #f8fafc;
}

body.home-theme-dark .chancay-login-modal__text {
  color: #94a3b8;
}

body.home-theme-dark .chancay-login-modal__label {
  color: #cbd5e1;
}

body.home-theme-dark .chancay-login-modal__input {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

body.home-theme-dark .chancay-login-modal__error {
  background: rgba(185, 28, 28, 0.15);
  color: #fecaca;
}

body.home-theme-dark .chancay-login-modal__register,
body.home-theme-dark .chancay-login-modal__forgot {
  color: #94a3b8;
}

body.home-theme-dark .chancay-login-modal__divider {
  color: #64748b;
}

body.home-theme-dark .chancay-login-modal__close {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

body.home-theme-dark .chancay-login-modal__close:hover {
  background: rgba(148, 163, 184, 0.28);
  color: #f8fafc;
}

@media (max-width: 767px) {
  .chancay-login-modal {
    padding: 12px;
  }

  .chancay-login-modal__body {
    padding: 32px 22px 24px;
  }
}
