/**
 * Exact Figma Design CSS - Email Only Version
 * Save as: /css/custom-um-auth.css in your theme
 */

:root {
  --gradient-primary: linear-gradient(
    135deg,
    #ffe492 0%,
    #cb54e5 49.52%,
    #6528b5 100%
  );
  --gradient-primary-light: linear-gradient(135deg, #f8f1fe 0%, #d49bff 100%);
  --gradient-secondary: linear-gradient(
    135deg,
    #fff93e 0%,
    #ff9a0c 49.52%,
    #d33c00 100%
  );
  --gradient-gray: linear-gradient(135deg, #f0f0f1 0%, #61656c 100%);
  --gradient-dark: linear-gradient(135deg, #61656c 0%, #0f1119 100%);
}

/* Hide Ultimate Member default forms */
.um-form.um-login,
.um-form.um-register,
.um-modal-overlay,
.um-popup-overlay,
.um .um-form {
  display: none !important;
}

.text-gradient-primary-light {
  background-image: linear-gradient(
    135deg,
    #f8f1fe 0%,
    #d49bff 100%
  ) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
/* .text-gradient-primary-light {
  display: inline-block;
} */

/* Custom Auth Modal - Exact Figma Match */
.custom-auth-modal {
  font-family: "Hind Siliguri", sans-serif;
  color: #ffffff;
  background: #0f1119;
  border: 1px solid #22262f;
  border-radius: 24px;
  padding: 32px 48px;
  /* width: 57%; */
  width: fit-content;
  height: auto;
  position: relative;
  margin: 0 auto !important;
}

/* Popup Maker Integration */
.pum-container .custom-auth-modal {
  margin: 0;
}

.pum-overlay {
  background: #0f1119 !important;
}

.pum-container {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.pum-content {
  background: transparent !important;
  padding: 0 !important;
}

/* Modal Header */
.modal-header {
  text-align: center;
  margin-bottom: 32px;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 24px 0;
  line-height: 150%;
}

/* Tab Buttons - Exact Figma Style */
.tab-buttons {
  display: flex;
  width: 350px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 6px;
  gap: 4px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.tab-btn {
  flex: 1;
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: center;
}

.tab-btn.active {
  background: #47494f;
  color: #ffffff;
}

.tab-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.05);
}

/* Form Styles */
.auth-form {
  width: 414px;
  background: #181a22;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 32px;
}
form#customRegisterForm {
  height: auto;
}
form#customLoginForm {
  height: auto;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
  color: rgb(255 255 255 / 0.8);
  line-height: 110%;
}

/* Input styling */
.form-input {
  width: 100%;
  padding: 15px 20px !important;
  background: #21232a !important;
  border: none !important; /* wrapper handles border */
  border-radius: 50px !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  height: 48px !important;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  align-self: stretch;
  position: relative;
  z-index: 0;
}

/* Gradient border on focus */
.form-input:focus {
  outline: none;
  background: white;
  box-shadow: none; /* remove old shadow */
}

.form-input:focus::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50px;
  padding: 2px; /* border thickness */
  background: linear-gradient(135deg, #f8f1fe 0%, #d49bff 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
  opacity: 0.8; /* stronger opacity on focus */
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
  font-size: 16px;
  font-weight: 500;
}

.form-input.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Password Field */
.password-field {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  position: absolute; /* Stack icons on top of each other */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.icon-eye,
.icon-eye-off {
  transition: opacity 0.25s ease;
}

.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden; /* Add visibility hidden for better hiding */
}

/* Optional: Add hover effect */
.password-toggle:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Field Hints */
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 20px;
  line-height: 1.4;
}

/* Error Messages */
.error-message {
  display: none;
  color: #ea2a2a;
  font-size: 13px;
  font-weight: 500;
  line-height: 110%;
  background: #ffe0e0;
  border: 1px solid #ff6868;
  border-radius: 8px;
  min-height: 34px;
  align-items: center;
  padding: 10px 0px 10px 12px;
  margin-bottom: 16px;
}

.site-btn-auth {
  width: 100%;
  position: relative;
  display: inline-flex; /* ensures text stays centered */
  justify-content: center;
  align-items: center;
  padding: 12px 28px; /* padding on button */
  overflow: hidden;
  border-radius: 50px;
  box-sizing: border-box;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  border: 1.4px solid rgba(255, 255, 255, 0.2);
  z-index: 0;
  transition: color 0.3s ease;
  -webkit-appearance: none;
  margin-bottom: 20px;
}

/* text span */
.site-btn-auth span {
  position: relative;
  z-index: 3; /* above pseudo-elements */
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  pointer-events: none; /* allow click to reach button */
}

/* gradient layers */
.site-btn-auth::before,
.site-btn-auth::after {
  content: "";
  position: absolute;
  inset: 0; /* top:0; left:0; width:100%; height:100%; */
  border-radius: inherit;
  z-index: -1; /* Changed from 1 to -1 to put backgrounds behind text */
  pointer-events: none;
  transition: opacity 0.45s ease-in-out;
}

.site-btn-auth::before {
  background-image: linear-gradient(
      0deg,
      rgba(244, 190, 255, 0.1) 0%,
      rgba(244, 190, 255, 0.1) 100%
    ),
    linear-gradient(135deg, #eccf73 0%, #900dc8 49.52%, #420098 100%);
  opacity: 1;
}

.site-btn-auth::after {
  background-image: linear-gradient(
      0deg,
      rgba(244, 190, 255, 0.1) 0%,
      rgba(244, 190, 255, 0.1) 100%
    ),
    linear-gradient(135deg, #43009c 0%, #b20ed6 50.48%, #eccf73 100%);
  opacity: 0;
}

/* Hover / focus */
.site-btn-auth:hover::before,
.site-btn-auth:focus::before {
  opacity: 0;
}

.site-btn-auth:hover::after,
.site-btn-auth:focus::after {
  opacity: 1;
}

.site-btn-auth:active {
  color: #fff !important; /* Force white text color */
  border-color: rgba(255, 255, 255, 0.2);
}

.site-btn-auth:active span {
  z-index: 10; /* Boost text z-index when active */
}

/* Disabled button */
.site-btn-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Additional fix for form submission states */
.site-btn-auth[disabled] span,
.site-btn-auth.submitting span {
  z-index: 10;
  color: #fff !important;
}

.input-wrapper {
  position: relative;
  border-radius: 50px;
  padding: 2px;
  background: transparent;
  transition: all 0.3s ease;
}

.input-wrapper .form-input {
  width: 100%;
  border: 0.5px solid rgba(255, 255, 255, 0.1234) !important;
  outline: none;
  border-radius: 50px;
  padding: 12px 20px;
  background: white;
  font-size: 16px;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.input-wrapper:focus-within {
  background: linear-gradient(135deg, #eccf73 0%, #900dc8 50%, #420098 100%);
}

/* Loading Spinner */
.loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Auth Links */
.auth-links {
  text-align: center;
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.5;
}

.auth-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.auth-link:hover {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-links span {
  color: rgba(255, 255, 255, 0.3);
  margin: 0 8px;
  font-weight: 400;
}

/* Divider */

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  gap: 1rem;
  margin: 24px 0 12px 0;
  font-size: 14px;
  font-weight: 500;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

/* Google Login Button */
.google-btn {
  width: 100%;
  padding: 10px;
  background: #21232b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.2px;
  height: 44px;
}

.google-btn:hover {
  /* background: #f9fafb; */
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: inherit !important;
}

/* .google-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
} */

.google-btn svg {
  flex-shrink: 0;
}

div.nsl-container .nsl-button-google[data-skin="dark"] {
  box-shadow: none !important;
  background: transparent !important;
}

/* Terms and Conditions Css */
p.terms_condition {
  position: relative;
  color: #85888e;
  font-size: 12px;
  font-weight: 400;
  line-height: 170%;
  top: 16px;
}

.terms_condition a {
  color: #cecfd2;
  text-decoration-line: underline;
}

/* Custom Ultimate Member Button */
.um-custom-btn {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.um-custom-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* Close Button for Popup Maker */
.pum-close {
  background: #272930 !important;
  color: rgba(255, 255, 255, 1) !important;
  border-radius: 50% !important;
  width: 48px !important;
  height: 48px !important;
  font-size: 20px !important;
  text-align: center !important;
  transition: all 0.3s ease !important;
  border: none !important;
  backdrop-filter: blur(10px) !important;
  font-weight: lighter !important;
  line-height: 0 !important;
  position: absolute !important;
  right: 210px !important;
}

.pum-close:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  transform: scale(1.05) !important;
}

@media (min-width: 1700px) {
  .pum-close {
    position: absolute !important;
    right: 350px !important;
  }
}

/* Mobile Responsive - Exact Figma Breakpoints */
@media (max-width: 768px) {
  .auth-form {
    width: 100%;
    padding: 24px 20px 24px 20px;
  }

  .custom-auth-modal {
    width: 96%;
    /* width: fit-content; */
    margin: 0 auto !important;
    background: transparent;
    border: none;
    padding: 0;
  }

  .tab-buttons {
    width: 100%;
  }

  .pum-container .custom-auth-modal {
    /* max-width: calc(100vw - 42px); */
    margin: 0 auto;
  }

  .form-input {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 16px 20px;
  }

  .form-group {
    margin-bottom: 16px;
  }
  p.terms_condition {
    font-size: 14px;
    top: 0;
  }

  .pum-close {
    display: none !important;
  }
}

/* @media (max-width: 480px) {
  .custom-auth-modal {
    padding: 24px 20px;
    margin: 12px;
    border-radius: 18px;
  }

  .pum-container .custom-auth-modal {
    max-width: calc(100vw - 24px);
    margin: 12px;
  }

  .modal-title {
    font-size: 18px;
    margin-bottom: 18px;
  }

  .tab-buttons {
    padding: 3px;
    gap: 3px;
  }

  .tab-btn {
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 10px;
  }

  .form-input {
    padding: 14px 18px;
    border-radius: 14px;
  }

  .site-btn-auth {
    padding: 16px 20px;
    border-radius: 14px;
  }

  .google-btn {
    padding: 16px 20px;
    border-radius: 14px;
    font-size: 14px;
  }
} */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .form-input {
    border-width: 2px;
  }

  .form-input:focus {
    border-width: 3px;
  }

  .tab-btn.active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .site-btn-auth:hover,
  .google-btn:hover,
  .um-custom-btn:hover {
    transform: none !important;
  }

  .site-btn-auth::before {
    display: none;
  }
}
