/* =============================================================================
   AUTH MODAL - Image 2 & 3 Style Theme
   ============================================================================= */

#login-modal.auth-modal {
  --auth-bg: #262626;
  --auth-input-bg: #303030;
  --auth-input-border: #404040;
  --auth-text: #e5e5e5;
  --auth-text-muted: #888888;
  --auth-primary-gradient: linear-gradient(90deg, #3b82f6, #8b5cf6);
  --auth-primary-hover: linear-gradient(90deg, #2563eb, #7c3aed);
}

#login-modal.auth-modal .auth-modal__wrapper {
  width: min(400px, calc(100vw - 2rem));
  border-radius: 20px;
  background: var(--auth-bg);
  color: var(--auth-text);
  padding: 2.5rem 2.2rem 2.2rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  font-family: inherit;
  box-sizing: border-box;
}

/* Close */
#login-modal.auth-modal .auth-modal__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  cursor: pointer;
  transition: all 0.2s;
}

#login-modal.auth-modal .auth-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
}

#login-modal.auth-modal .auth-modal__close svg {
  width: 0.8rem;
  height: 0.8rem;
}

/* Header Logo Ring */
#login-modal.auth-modal .auth-modal__header {
  display: flex;
  justify-content: center;
  margin-bottom: 2.2rem;
}

#login-modal.auth-modal .auth-modal__logo-ring {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  padding: 3px;
  background: var(--auth-primary-gradient);
}

#login-modal.auth-modal .auth-modal__logo-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--auth-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  color: #fff;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
}

#login-modal.auth-modal .auth-modal__logo-inner ._4k {
  font-size: 1.6rem;
  color: #fca5a5;
  /* slight tint for the logo text */
}

#login-modal.auth-modal .auth-modal__logo-inner ._novel {
  font-size: 0.8rem;
  font-weight: 500;
  font-style: normal;
  color: #f472b6;
}

/* Notice */
#login-modal.auth-modal .auth-modal__notice {
  margin-bottom: 0.8rem;
  border-radius: 6px;
  padding: 0.6rem;
  font-size: 0.8rem;
  text-align: center;
  display: none;
}

#login-modal.auth-modal .auth-modal__notice._error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

#login-modal.auth-modal .auth-modal__notice._success {
  display: block;
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Panels */
#login-modal.auth-modal .auth-modal__panel {
  display: none;
}

#login-modal.auth-modal .auth-modal__panel._active {
  display: block;
}

/* Form */
#login-modal.auth-modal .auth-modal__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}

/* Inputs */
#login-modal.auth-modal .auth-modal__input-wrap {
  height: 52px;
  border-radius: 12px;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  /* subtle border */
  display: flex;
  align-items: center;
  transition: border-color 0.2s;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
}

#login-modal.auth-modal .auth-modal__input-wrap:focus-within {
  border-color: #6366f1;
}

#login-modal.auth-modal .auth-modal__input-icon {
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text-muted);
  flex-shrink: 0;
}

#login-modal.auth-modal .auth-modal__input-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

#login-modal.auth-modal .auth-modal__input-wrap input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--auth-text);
  padding: 0 1rem 0 0;
  font-size: 0.95rem;
  line-height: normal;
  text-align: left !important;
  min-width: 0;
  box-sizing: border-box;
}

#login-modal.auth-modal .auth-modal__input-wrap input::placeholder {
  color: var(--auth-text-muted);
}

#login-modal.auth-modal .auth-modal__input-wrap input:focus {
  outline: none;
  box-shadow: none;
}

/* Fix browser autofill background color */
#login-modal.auth-modal .auth-modal__input-wrap input:-webkit-autofill,
#login-modal.auth-modal .auth-modal__input-wrap input:-webkit-autofill:hover,
#login-modal.auth-modal .auth-modal__input-wrap input:-webkit-autofill:focus,
#login-modal.auth-modal .auth-modal__input-wrap input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--auth-input-bg) inset !important;
  -webkit-text-fill-color: var(--auth-text) !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Captcha Layout */
#login-modal.auth-modal .auth-modal__captcha-wrap {
  display: flex;
  gap: 0.8rem;
  align-items: stretch;
}

#login-modal.auth-modal .auth-modal__captcha-wrap .auth-modal__input-wrap {
  flex: 1;
}

#login-modal.auth-modal .auth-modal__captcha-img {
  width: 120px;
  height: 52px;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

#login-modal.auth-modal .auth-modal__captcha-text {
  color: #333;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  font-family: 'Courier New', monospace;
  position: relative;
  z-index: 1;
}

/* Button */
#login-modal.auth-modal .auth-modal__submit-btn {
  width: 100%;
  height: 52px;
  border-radius: 12px;
  border: none;
  background: var(--auth-primary-gradient);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.2rem;
}

#login-modal.auth-modal .auth-modal__submit-btn:hover {
  background: var(--auth-primary-hover);
  opacity: 0.95;
}

#login-modal.auth-modal .auth-modal__submit-btn:active {
  transform: translateY(1px);
}

/* Agreement Checkbox */
#login-modal.auth-modal .auth-modal__agreement {
  margin-top: -0.2rem;
  margin-bottom: 0.8rem;
}

#login-modal.auth-modal .auth-modal__checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--auth-text-muted);
  line-height: 1.5;
}

#login-modal.auth-modal .auth-modal__checkbox-wrap input {
  display: none;
}

#login-modal.auth-modal .auth-modal__checkbox-mark {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--auth-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-top: 2px;
}

#login-modal.auth-modal .auth-modal__checkbox-mark svg {
  width: 10px;
  height: 10px;
  stroke: #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s;
  stroke-width: 3;
}

#login-modal.auth-modal .auth-modal__checkbox-wrap input:checked~.auth-modal__checkbox-mark {
  background: #a855f7;
  border-color: #a855f7;
}

#login-modal.auth-modal .auth-modal__checkbox-wrap input:checked~.auth-modal__checkbox-mark svg {
  opacity: 1;
  transform: scale(1);
}

#login-modal.auth-modal .auth-modal__agreement-text {
  flex: 1;
}

#login-modal.auth-modal .auth-modal__agreement-text a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  /* prevent agreement title from breaking awkwardly */
}

#login-modal.auth-modal .auth-modal__agreement-text a:hover {
  text-decoration: underline;
}

/* Divider Line */
#login-modal.auth-modal .auth-modal__line-divider {
  width: 100%;
  height: 1px;
  background: var(--auth-input-border);
  margin: 1.75rem 0 1.5rem;
}

/* Footer Links ("No account? Register") */
#login-modal.auth-modal .auth-modal__footer-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}

#login-modal.auth-modal .auth-modal__footer-links ._gray {
  color: var(--auth-text-muted);
}

#login-modal.auth-modal .auth-modal__footer-links ._link {
  background: none;
  border: none;
  padding: 0;
  color: #e5e5e5;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

#login-modal.auth-modal .auth-modal__footer-links ._link:hover {
  color: #a855f7;
}

#login-modal.auth-modal .auth-modal__footer-links ._right {
  margin-left: auto;
}

/* Social login text (centered, no lines) */
#login-modal.auth-modal .auth-modal__social-text {
  text-align: center;
  color: var(--auth-text-muted);
  font-size: 0.85rem;
  margin: 2.25rem 0 1.5rem;
}

#login-modal.auth-modal .auth-modal__social-text span {
  padding: 0;
}

/* Social Buttons */
#login-modal.auth-modal .auth-modal__social {
  display: flex;
  justify-content: center;
}

#login-modal.auth-modal .auth-modal__google-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #db4437;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0;
  /* hide any remaining text */
  transition: transform 0.2s, background 0.2s;
}

#login-modal.auth-modal .auth-modal__google-button:hover {
  background: #c53929;
  transform: scale(1.05);
}

#login-modal.auth-modal .auth-modal__google-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#login-modal.auth-modal .auth-modal__google-icon svg {
  width: 100%;
  height: 100%;
  fill: #fff;
}

#login-modal.auth-modal .auth-modal__social--disabled {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px dashed var(--auth-input-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text-muted);
}

#login-modal.auth-modal .auth-modal__social--disabled svg {
  width: 20px;
  height: 20px;
}

/* Mobile */
@media (max-width: 420px) {
  #login-modal.auth-modal .auth-modal__wrapper {
    padding: 1.5rem 1.25rem;
  }
}