/* 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: rgba(0, 0, 50, 1);
  background-size: cover;
  border-radius: 12px;
  box-shadow:
    0 0 50px rgba(0, 0, 0, 0.9),
    inset 0 0 100px rgba(0, 0, 0, 0.6);
  padding: 35px 25px 25px; /* Reduced padding for compactness */
  width: 400px;
  max-width: 95vw;
  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;
  scrollbar-width: thin;
  scrollbar-color: #f2ce00 rgba(0, 0, 50, 1);
}

/* 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: #f2ce00;
  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: #a90000;
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  z-index: 20;
  border-radius: 50%;
  width: 28px; /* Smaller */
  height: 28px; /* Smaller */
  font-size: 18px;
  line-height: 24px;
  text-align: center;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s;
}

.login-close:hover {
  background: #d40000;
  transform: scale(1.1);
}

/* Logo */
.login-modal .login-logo img {
  display: block;
  margin: 10px auto 10px; /* Reduced margins */
  max-width: 120px; /* Reduced size */
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
  position: relative;
  z-index: 16;
}

/* Title */
.login-modal .login-title {
  font-family: "Oswald", sans-serif;
  color: #f2ce00;
  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.4);
  border: 1px solid #2d6db9;
  border-radius: 6px;
  color: #f2ce00;
  font-family: "Inter", sans-serif;
  padding: 10px; /* Compact padding */
  margin-bottom: 12px; /* Compact margin */
  width: 100%;
  box-sizing: border-box;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
  font-size: 14px;
}

.login-modal .form-input:focus {
  outline: none;
  border-color: #f2ce00;
  background: rgba(0, 0, 0, 0.6);
  box-shadow:
    0 0 8px rgba(242, 0, 141, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

/* Custom Button (BET30 Style) */
.btn-login-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px; /* Reduced padding */
  background: linear-gradient(to bottom, #f2ce00 0%, #2d6db9 100%);
  border: 1px solid #f2ce00;
  border-bottom: 4px solid #8e0052;
  border-radius: 8px;
  color: #ffffff;
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 16px; /* Reduced font size */
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 10px; /* Reduced margin */
  transition:
    transform 0.1s,
    filter 0.2s,
    border-bottom-width 0.1s,
    margin-top 0.1s;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

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

.btn-login-custom:active {
  transform: translateY(2px);
  border-bottom-width: 0;
  margin-top: 14px; /* Compensate for border loss (10 + 4) */
  box-shadow: none;
}

/* 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: #f2ce00;
  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: 12px;
  background: none;
  border: none;
  color: #f2ce00;
  cursor: pointer;
  font-size: 1.2em;
}

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

.login-modal .login-content.auth-login {
  width: 620px;
  max-width: 95vw;
  padding: 26px 26px 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 50, 1);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-modal .login-content.auth-login .login-close {
  top: 14px;
  right: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-modal .login-content.auth-login .login-close:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: none;
}

.login-modal .auth-mobile-logo {
  display: block;
  margin: 0 0 18px;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
}

.login-modal .auth-tabs {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 42px;
  margin: 0 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.login-modal .auth-tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 12px 8px 14px;
  color: rgba(255, 255, 255, 0.65);
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  position: relative;
}

.login-modal .auth-tab.is-active {
  color: #ffffff;
}

.login-modal .auth-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: #f2ce00;
}

.login-modal .input-group {
  margin: 14px 0 0;
}

.login-modal .auth-label {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 10px;
}

.login-modal .auth-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(33, 116, 241, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.login-modal .auth-field-icon {
  color: rgba(255, 255, 255, 0.7);
  display: inline-flex;
}

.login-modal .login-content.auth-login .form-input {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 15px;
  box-shadow: none;
  min-height: 24px;
}

.login-modal .login-content.auth-login .form-input:focus {
  outline: none;
  background: transparent;
  box-shadow: none;
}

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

.login-modal .login-content.auth-login .password-toggle {
  position: static;
  background: transparent;
  border: 0;
  color: #f2ce00;
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-modal .login-content.auth-login .password-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.login-modal .auth-forgot {
  display: inline-block;
  margin: 14px 0 0;
  color: #f2ce00;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.login-modal .auth-forgot:hover {
  text-decoration: underline;
}

.login-modal .login-content.auth-login .btn-login-custom {
  margin-top: 18px;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  text-transform: none;
  font-family: "Inter", sans-serif;
  font-weight: 800;
  background: #f2ce00;
  color: black;
  box-shadow: 0 14px 36px rgba(33, 116, 241, 0.28);
}

.login-modal .login-content.auth-login .btn-login-custom:active {
  margin-top: 18px;
}

.login-modal .login-content.auth-login .auth-terms {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.58);
  text-align: center;
}

.login-modal .login-content.auth-login .auth-terms a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-modal .login-content.auth-login .login-error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.16);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
}

@media (max-width: 520px) {
  .login-modal .login-content.auth-login {
    padding: 22px 18px 18px;
  }
  .login-modal .auth-tabs {
    gap: 26px;
  }
}
