/* BET30 Login & Register Modal Redesign */

/* Backdrop */
.login-modal {
  background: rgba(0, 0, 0, 0.85); /* Darker backdrop */
  backdrop-filter: blur(8px);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2147483647 !important; /* Max z-index to ensure it covers everything */
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
}

.login-modal.open {
  display: flex;
}

/* Modal Content Container */
.login-modal .login-content {
  background:
    radial-gradient(
      1200px 500px at 50% -20%,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0) 60%
    ),
    linear-gradient(180deg, #0b1220 0%, #050a14 100%);
  border-radius: 16px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.7);
  padding: 26px 24px 22px;
  width: 460px;
  max-width: 92vw;
  max-height: 95vh; /* Ensure it fits in viewport */
  overflow-y: auto; /* Allow scrolling on small screens */
  color: #fff;
  /* overflow: visible;  Removed to allow scrolling, decoration needs handling */
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Custom Scrollbar */
.login-modal .login-content::-webkit-scrollbar {
  width: 4px;
}
.login-modal .login-content::-webkit-scrollbar-track {
  background: transparent;
}
.login-modal .login-content::-webkit-scrollbar-thumb {
  background-color: #f07400;
  border-radius: 3px;
}

/* Liana Decoration (Top) - Adjusted to stay visible or be inside */
.modal-decoration-top {
  position: absolute;
  top: 0; /* Moved inside visually */
  left: 0;
  width: 100%;
  height: 40px; /* Reduced height */
  background-size: 100% auto;
  z-index: 15;
  pointer-events: none;
  opacity: 0.8;
}

/* Close Button */
.login-close {
  position: absolute;
  top: 10px; /* Moved inside */
  right: 10px; /* Moved inside */
  background: transparent;
  border: none;
  box-shadow: none;
  z-index: 20;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 1;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition:
    filter 0.15s ease,
    transform 0.15s ease,
    opacity 0.15s ease;
}

.login-close:hover {
  opacity: 1;
  filter: brightness(1.05);
  transform: scale(1.03);
}

/* Logo */
.login-modal .login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 10px;
}
.login-modal .login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.login-modal .login-logo img {
  width: 117px;
  height: 132px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
}
.login-modal .login-brand-text {
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 1px;
  color: #ff7a00;
  line-height: 1;
}

.login-modal .login-subtitle {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  margin: 0 0 18px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

/* Title */
.login-modal .login-title {
  font-family: "Oswald", sans-serif;
  color: #f07400;
  text-align: center;
  font-size: 22px; /* Reduced size */
  margin-bottom: 15px;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Form Inputs */
.login-modal .login-label {
  color: #e0e0e0;
  text-shadow: 0 1px 2px #000;
  font-family: "Oswald", sans-serif;
  letter-spacing: 1px;
  font-size: 13px; /* Slightly smaller */
  margin-bottom: 4px;
  display: block;
}

.login-modal .form-input {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 155, 41, 0.822);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.95);
  font-family: "Inter", sans-serif;
  padding: 14px 14px;
  margin-bottom: 12px; /* Compact margin */
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
  font-size: 14px;
}

.login-modal .form-input:focus {
  outline: none;
  border-color: #f07400;
  background: rgba(0, 0, 0, 0.22);
  box-shadow:
    0 0 0 1px rgba(242, 0, 141, 0.25),
    0 10px 24px rgba(0, 0, 0, 0.28);
}

.login-modal .form-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

/* Custom Button (BET30 Style) */
.btn-login-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px;
  background: #f07400;
  border: none;
  border-radius: 14px;
  color: #ffffff;
  font-family: "Oswald", sans-serif;
  font-weight: 800;
  font-size: 16px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 6px;
  transition:
    transform 0.1s,
    filter 0.2s,
    opacity 0.2s;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
}

.btn-login-custom:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-login-custom:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

/* Helper elements within button - kept for structure compatibility but hidden if using CSS only */
.btn-login-custom .btn-l,
.btn-login-custom .btn-r {
  display: none;
}
.btn-login-custom .btn-c {
  background: none;
  width: auto;
  flex-grow: 0;
}

/* Meta Links */
.login-modal .login-meta {
  color: #bbb;
  font-size: 12px; /* Slightly smaller */
  margin-bottom: 10px; /* Reduced margin */
  text-align: center;
}

.login-modal .login-meta a {
  color: #f07400;
  text-decoration: none;
  font-weight: 700;
}

.login-modal .login-meta a:hover {
  text-decoration: underline;
}

/* Password Toggle */
.login-modal .password-wrap {
  position: relative;
  width: 100%;
}
.login-modal .password-toggle {
  position: absolute;
  right: 10px;
  top: 14px;
  background: none;
  border: none;
  color: #f07400;
  cursor: pointer;
  font-size: 1.2em;
}

/* Checkbox Style Override */
.login-modal input[type="checkbox"] {
  accent-color: #f07400;
}

#loginModal .login-content.auth-login {
  width: 520px;
  max-width: 92vw;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: #0b0e12;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
#loginModal .login-content.auth-login::before {
  content: none;
}
#loginModal .auth-login-grid {
  position: relative;
  z-index: 1;
  display: block;
  min-height: auto;
}
#loginModal .auth-visual {
  display: none;
}
#loginModal .auth-brand-logo {
  width: 160px;
  height: auto;
  margin-bottom: auto; /* Empujar hacia arriba */
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}
#loginModal .auth-cat {
  width: auto;
  height: 120%; /* Hacerla más alta que el contenedor */
  max-width: 420px;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  object-fit: contain;
  object-position: bottom;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55));
}
#loginModal .auth-visual-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* Alinear el texto hacia abajo si la imagen está atrás */
  text-align: center;
  width: 100%;
  height: 100%;
  padding-top: 56px;
}
#loginModal .auth-hero-copy {
  display: block;
  margin-top: auto; /* Empujar hacia abajo */
}
#loginModal .auth-hero-title {
  font-weight: 900;
  font-size: 32px;
  line-height: 1.1;
  color: rgba(255, 255, 255, 0.98);
  text-transform: uppercase;
}
#loginModal .auth-hero-sub {
  margin-top: 8px;
  font-weight: 700;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.82);
}
#loginModal .auth-form-area {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 26px 26px 28px;
  gap: 14px;
  align-items: stretch;
}
#loginModal .auth-top-logo {
  display: flex;
  justify-content: center;
  margin: 2px 0 12px;
}
#loginModal .auth-top-logo img {
  height: 44px;
  width: auto;
  display: block;
}
#loginModal .auth-mobile-logo {
  display: none;
}
#loginModal .auth-tabs {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
#loginModal .auth-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 900;
  font-size: 15px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
#loginModal .auth-tab.is-active {
  color: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.9);
}
#loginModal .auth-title {
  display: none;
}
#loginModal .auth-label {
  display: none;
}
#loginModal .auth-login .login-form {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#loginModal .auth-form-pane {
  width: 100%;
}
#loginModal .auth-login .input-group {
  margin: 0;
}
#loginModal .auth-login .auth-field {
  position: relative;
  width: 100%;
}
#loginModal .auth-login .auth-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.62);
  pointer-events: none;
  display: inline-flex;
}
#loginModal .auth-login .auth-field .form-input {
  padding-left: 46px;
  height: 52px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  margin-bottom: 0;
  width: 100%;
  color: rgba(255, 255, 255, 0.95);
  font-size: 14px;
}
#loginModal .auth-login .password-wrap .form-input {
  padding-right: 46px;
}
#loginModal .auth-login .form-input:focus {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 0 3px rgba(255, 43, 111, 0.18);
  outline: none;
}
#loginModal .auth-login .password-toggle {
  color: rgba(255, 255, 255, 0.85);
  top: 50%;
  transform: translateY(-50%);
  right: 14px;
  position: absolute;
  background: none;
  border: none;
  cursor: pointer;
}
#loginModal .auth-login .btn-login-custom {
  width: 100%;
  height: 52px;
  margin: 8px auto 0;
  background: linear-gradient(180deg, #2bceff 0%, #0067d1 100%);
  color: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  font-family: "Inter", sans-serif;
  font-weight: 800;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition:
    filter 0.2s,
    transform 0.2s;
}
#loginModal .auth-login .btn-login-custom:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
#loginModal .auth-forgot {
  display: inline-flex;
  align-self: flex-start;
  margin-top: -6px;
  font-weight: 700;
  font-size: 14px;
  color: #3aa3ff;
  text-decoration: none;
}
#loginModal .auth-forgot:hover {
  text-decoration: underline;
}
#loginModal .auth-terms {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}
#loginModal .auth-terms a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
}
#loginModal .auth-terms a:hover {
  color: #fff;
}
#loginModal .auth-login .login-error {
  margin-top: 6px;
  color: #ff4a4a;
  font-size: 13px;
  text-align: center;
}

.auth-mobile-bar {
  display: none;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  #loginModal.login-modal {
    align-items: stretch;
    justify-content: stretch;
  }
  #loginModal .login-close {
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
  }
  #loginModal .login-content.auth-login {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  #loginModal .auth-login-grid {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  #loginModal .auth-form-area {
    padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
    align-items: stretch;
    justify-content: flex-start;
    flex: 1;
    overflow: auto;
  }
  #loginModal .auth-mobile-logo {
    display: flex;
    justify-content: center;
    margin: 8px 0 8px;
  }
  #loginModal .auth-tabs {
    margin-top: 6px;
  }
  #loginModal .login-close-desktop {
    display: inline-flex;
  }
  #loginModal .auth-login .login-form {
    max-width: 420px;
    margin: 0 auto;
  }
}
#loginModal .auth-visual::after {
  content: none;
}
#loginModal .auth-visual::before {
  content: none;
}
#loginModal .auth-hero-copy {
  display: block;
  max-width: 66%;
  padding-right: 8px;
}
#loginModal .auth-hero-title {
  font-weight: 900;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.98);
  text-transform: uppercase;
}
#loginModal .auth-hero-sub {
  margin-top: 8px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.82);
}
#loginModal .auth-cat {
  display: none;
}
#loginModal .auth-form-area {
  padding: 26px 26px 28px;
  align-items: stretch;
  justify-content: flex-start;
  background: transparent;
  backdrop-filter: none;
  border-top: none;
  flex: 0 0 auto;
  overflow: visible;
}
#loginModal .auth-mobile-logo {
  display: flex;
  justify-content: center;
  margin: 8px 0 8px;
}
#loginModal .auth-tabs {
  margin-top: 6px;
}
#loginModal .auth-title {
  display: none;
}
#loginModal .auth-label {
  display: none;
}
#loginModal .auth-login .btn-login-custom {
  width: min(360px, 100%);
  margin: 18px auto 0;
  background: linear-gradient(180deg, #2bceff 0%, #0067d1 100%);
  color: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 10px 26px rgba(255, 0, 87, 0.22);
  opacity: 1;
  font-family: "Inter", sans-serif;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  height: 52px;
}
#loginModal .auth-login .password-toggle {
  top: 50%;
  transform: translateY(-50%);
  right: 14px;
}
#loginModal .login-close-desktop {
  display: inline-flex;
}
#loginModal .auth-mobile-bar {
  display: none !important;
}
#loginModal .auth-back {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0;
}
#loginModal .auth-mobile-heading {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.2px;
  text-transform: none;
}
#loginModal .auth-login .login-form {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#loginModal .auth-tabs {
  width: 100%;
  justify-content: center;
  gap: 18px;
  margin: 6px 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
#loginModal .auth-tab {
  padding: 12px 12px 14px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.74);
}
#loginModal .auth-tab.is-active {
  color: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.9);
}
#loginModal .auth-login .form-input {
  height: 52px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
}
#loginModal .auth-login .auth-field-icon {
  color: rgba(255, 255, 255, 0.62);
}
#loginModal .auth-forgot {
  display: inline-flex;
  align-self: flex-start;
  margin-top: -2px;
  font-weight: 700;
  font-size: 14px;
  color: #3aa3ff;
  text-decoration: none;
}
#loginModal .auth-forgot:hover {
  text-decoration: underline;
}
#loginModal .auth-terms {
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.42);
  text-align: center;
}
#loginModal .auth-terms a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: underline;
  font-weight: 700;
}
