/**
 * LoginPop Stylesheet
 */

/* ==========================================================================
   1. SHARED BUTTON BASE (trigger + account)
   ========================================================================== */

.loginpop-trigger,
.loginpop-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.75em 1.5em;
  font: inherit;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  box-shadow: none;
  transition: background 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease,
              filter 0.3s ease,
              opacity 0.3s ease;
}

.loginpop-trigger:focus-visible,
.loginpop-account:focus-visible {
  outline: 2px solid #4A90D9;
  outline-offset: 2px;
}

/* Icon display */
.loginpop-btn-icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.loginpop-btn-icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.loginpop-btn-icon i {
  line-height: 1;
}

/* ==========================================================================
   2. BUTTON PRESETS — Trigger
   ========================================================================== */

.loginpop-trigger.loginpop-style-solid {
  background-color: var(--loginpop-primary, #4A90D9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.loginpop-trigger.loginpop-style-solid:hover {
  filter: brightness(0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.loginpop-trigger.loginpop-style-outline {
  background: transparent;
  border: 2px solid currentColor;
}
.loginpop-trigger.loginpop-style-outline:hover {
  background-color: var(--loginpop-primary, #4A90D9);
  color: #ffffff;
  border-color: var(--loginpop-primary, #4A90D9);
}

.loginpop-trigger.loginpop-style-pill {
  background-color: var(--loginpop-primary, #4A90D9);
  border-radius: 50px;
  padding: 0.75em 2em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.loginpop-trigger.loginpop-style-pill:hover {
  filter: brightness(0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.loginpop-trigger.loginpop-style-gradient {
  background: linear-gradient(
    135deg,
    var(--loginpop-primary, #4A90D9),
    color-mix(in srgb, var(--loginpop-primary, #4A90D9), white 30%)
  );
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.loginpop-trigger.loginpop-style-gradient:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.loginpop-trigger.loginpop-style-minimal {
  background: transparent;
  padding: 0.5em 0.25em;
  border-radius: 0;
}
.loginpop-trigger.loginpop-style-minimal:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.loginpop-trigger.loginpop-style-dark {
  background-color: #1a1a2e;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.loginpop-trigger.loginpop-style-dark:hover {
  background-color: #25254a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.loginpop-trigger.loginpop-style-plain,
.loginpop-account.loginpop-style-plain {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.loginpop-trigger.loginpop-style-plain:hover,
.loginpop-account.loginpop-style-plain:hover {
  opacity: 0.7;
}

/* ==========================================================================
   3. BUTTON PRESETS — Account (logged-in)
   ========================================================================== */

.loginpop-account.loginpop-style-solid {
  background-color: var(--loginpop-primary, #4A90D9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.loginpop-account.loginpop-style-solid:hover {
  filter: brightness(0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.loginpop-account.loginpop-style-outline {
  background: transparent;
  border: 2px solid currentColor;
}
.loginpop-account.loginpop-style-outline:hover {
  background-color: var(--loginpop-primary, #4A90D9);
  color: #ffffff;
  border-color: var(--loginpop-primary, #4A90D9);
}

.loginpop-account.loginpop-style-pill {
  background-color: var(--loginpop-primary, #4A90D9);
  border-radius: 50px;
  padding: 0.75em 2em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.loginpop-account.loginpop-style-pill:hover {
  filter: brightness(0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.loginpop-account.loginpop-style-gradient {
  background: linear-gradient(
    135deg,
    var(--loginpop-primary, #4A90D9),
    color-mix(in srgb, var(--loginpop-primary, #4A90D9), white 30%)
  );
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.loginpop-account.loginpop-style-gradient:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.loginpop-account.loginpop-style-minimal {
  background: transparent;
  padding: 0.5em 0.25em;
  border-radius: 0;
}
.loginpop-account.loginpop-style-minimal:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.loginpop-account.loginpop-style-dark {
  background-color: #1a1a2e;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.loginpop-account.loginpop-style-dark:hover {
  background-color: #25254a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* Logout link */
.loginpop-logout {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: #9ca3af;
  text-decoration: none;
  text-align: center;
  transition: color 0.3s ease;
}
.loginpop-logout:hover {
  color: #ef4444;
  text-decoration: underline;
}

/* ==========================================================================
   4. OVERLAY
   ========================================================================== */

.loginpop-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loginpop-overlay.loginpop-active {
  visibility: visible;
  opacity: 1;
}

.loginpop-overlay.loginpop-closing {
  visibility: visible;
  opacity: 0;
}

/* ==========================================================================
   5. MODAL
   ========================================================================== */

.loginpop-modal {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  width: 420px;
  max-width: 90vw;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2),
              0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: loginpopIn 0.3s ease both;
}

.loginpop-overlay.loginpop-closing .loginpop-modal {
  animation: loginpopOut 0.3s ease both;
}

/* ==========================================================================
   6. CLOSE BUTTON
   ========================================================================== */

.loginpop-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.3s ease, background 0.3s ease;
}
.loginpop-close:hover {
  color: #374151;
  background: #f3f4f6;
}

/* ==========================================================================
   7. ANIMATIONS
   ========================================================================== */

@keyframes loginpopIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes loginpopOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(0.92) translateY(10px); }
}
@keyframes loginpopSpin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   8. FORM — TITLE
   ========================================================================== */

.loginpop-title {
  text-align: center;
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
}

/* ==========================================================================
   9. FORM — FIELDS
   ========================================================================== */

.loginpop-field {
  margin-bottom: 1rem;
}

.loginpop-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.loginpop-field input[type="text"],
.loginpop-field input[type="email"],
.loginpop-field input[type="password"] {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9375rem;
  color: #111827;
  background: #ffffff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.loginpop-field input:focus {
  outline: none;
  border-color: #4A90D9;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}

/* ==========================================================================
   10. PASSWORD TOGGLE
   ========================================================================== */

.loginpop-password-wrapper {
  position: relative;
}

.loginpop-password-wrapper input {
  padding-right: 2.75rem;
}

.loginpop-toggle-pw {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.875rem;
  transition: color 0.3s ease;
}
.loginpop-toggle-pw:hover {
  color: #374151;
}

/* ==========================================================================
   11. REMEMBER ME
   ========================================================================== */

.loginpop-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  margin-bottom: 1rem;
}

.loginpop-remember input[type="checkbox"] {
  accent-color: #4A90D9;
  cursor: pointer;
}

/* ==========================================================================
   12. MESSAGES
   ========================================================================== */

.loginpop-message {
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.loginpop-message.error {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.loginpop-message.success {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* ==========================================================================
   13. SUBMIT BUTTON
   ========================================================================== */

.loginpop-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background-color: #4A90D9;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.loginpop-submit:hover {
  filter: brightness(0.85);
}

.loginpop-submit.loading {
  opacity: 0.7;
  pointer-events: none;
}
.loginpop-submit.loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: loginpopSpin 0.6s linear infinite;
  flex-shrink: 0;
}

/* ==========================================================================
   14. LINKS (Forgot Password / Register)
   ========================================================================== */

.loginpop-links {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.loginpop-links a {
  color: #4A90D9;
  text-decoration: none;
  transition: color 0.3s ease;
}
.loginpop-links a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==========================================================================
   15. RESPONSIVE
   ========================================================================== */

@media (max-width: 480px) {
  .loginpop-modal {
    padding: 1.5rem;
  }
  .loginpop-title {
    font-size: 1.25rem;
  }
}

/* ==========================================================================
   16. ELEMENTOR EDITOR
   ========================================================================== */

.elementor-editor-active .loginpop-overlay {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ==========================================================================
   17. SHORTCODE LINK
   ========================================================================== */

.loginpop-shortcode {
  display: inline;
}

.loginpop-trigger-link {
  display: inline !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #4A90D9;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.loginpop-trigger-link:hover {
  filter: none !important;
  opacity: 0.7;
}
