/* Login — split mock + paleta oscura Sorex2 / Metin2 */

.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  background:
    radial-gradient(
      ellipse 70% 50% at 20% 10%,
      rgba(212, 160, 32, 0.12),
      transparent 55%
    ),
    radial-gradient(
      ellipse 50% 40% at 90% 90%,
      rgba(120, 70, 20, 0.16),
      transparent 50%
    ),
    #050403;
  overflow-x: hidden;
}

.login-page #lang-slider {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  width: 44px;
  height: 44px;
  z-index: 5;
}

.login-page #lang-slider .lang-active {
  width: 44px;
  height: 44px;
  border-radius: 0 27px 0 12px;
  border: 1px solid rgba(212, 160, 32, 0.28);
  border-top: 0;
  border-right: 0;
  background: rgba(14, 10, 7, 0.98);
  box-shadow: none;
}

.login-page #lang-slider .lang-tray {
  left: auto !important;
  right: 0 !important;
  top: 44px !important;
  height: auto !important;
  max-height: 0;
  max-width: none !important;
  flex-direction: column;
  gap: 4px;
  padding: 0 !important;
  border-radius: 12px 0 0 12px;
  border: 1px solid rgba(212, 160, 32, 0.22);
  border-right: 0;
  background: rgba(14, 10, 7, 0.98);
  box-shadow: -8px 12px 28px rgba(0, 0, 0, 0.4);
}

.login-page #lang-slider:hover .lang-tray,
.login-page #lang-slider:focus-within .lang-tray {
  max-height: 320px;
  max-width: none !important;
  padding: 8px !important;
}

.login-stage {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: loginIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes loginIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.login-frame {
  position: relative;
  width: 100%;
  min-height: min(640px, calc(100vh - 80px));
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(212, 160, 32, 0.28);
  background: linear-gradient(180deg, #1a140c 0%, #0e0a07 100%);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ── Panel visual ── */
.login-visual {
  position: relative;
  z-index: 2;
  min-height: 100%;
  padding: 32px 40px 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f5ead6;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 36px) 0, 100% 100%, 0 100%);
}

.login-visual-art {
  position: absolute;
  inset: -4%;
  z-index: 0;
  pointer-events: none;
  background: url("../imagenes/fondo_index.png") center / cover no-repeat;
  transform: scale(1.06);
  transform-origin: center center;
  will-change: transform;
  animation: artPulse 10s ease-in-out infinite;
}

@keyframes artPulse {
  0%,
  100% {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  50% {
    transform: scale(1.12) translate3d(-0.6%, -0.4%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-visual-art {
    animation: none;
    transform: scale(1.06);
  }
}

.login-visual-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(5, 4, 3, 0.28) 0%,
      rgba(5, 4, 3, 0.08) 35%,
      rgba(5, 4, 3, 0.55) 78%,
      rgba(5, 4, 3, 0.82) 100%
    ),
    linear-gradient(90deg, transparent 70%, rgba(12, 9, 6, 0.35) 100%),
    radial-gradient(
      ellipse at 28% 72%,
      rgba(212, 160, 32, 0.14),
      transparent 55%
    );
}

.login-visual > *:not(.login-visual-art) {
  position: relative;
  z-index: 1;
}

/* Difuminado oscuro que sale desde abajo del bloque hacia arriba
   (por debajo de los métodos de pago). El selector mantiene mayor
   especificidad que la regla de arriba para conservar position:absolute. */
.login-page .login-visual .login-visual-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 62%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(3, 2, 1, 0.95) 0%,
    rgba(3, 2, 1, 0.85) 22%,
    rgba(3, 2, 1, 0.55) 55%,
    rgba(3, 2, 1, 0.22) 80%,
    rgba(3, 2, 1, 0) 100%
  );
}

.login-visual-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  max-width: calc(100% - 28px);
}

.login-visual-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.login-visual-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  padding: 3px;
}

.login-visual-brand strong {
  font-family: "Marcellus SC", Georgia, serif;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(
    180deg,
    #f9ecc0 0%,
    #e8c35a 42%,
    #c49220 78%,
    #8a6410 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-visual-copy {
  margin-top: auto;
  padding-right: 24px;
  text-align: left;
}

.login-visual-kicker {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d4a020;
}

.login-visual-copy h2 {
  margin: 0 0 12px;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: clamp(30px, 3.5vw, 44px);
  font-weight: 400;
  line-height: 1.1;
  color: #f5ead6;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.login-visual-copy > p:not(.login-visual-kicker) {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(245, 234, 214, 0.72);
  max-width: 32em;
}

.login-visual-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.login-visual-badges span {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(212, 160, 32, 0.22);
  background: rgba(10, 8, 6, 0.55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f0d078;
  backdrop-filter: blur(8px);
}

.login-visual-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.login-visual-foot p {
  margin: 0;
  font-size: 12px;
  color: rgba(245, 234, 214, 0.55);
}

.login-pay-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-pay-row img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px;
}

/* ── Panel formulario (oscuro / oro) ── */
.login-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: -40px;
  padding: 36px 44px 36px 72px;
  background: linear-gradient(180deg, #1a140c 0%, #0e0a07 100%);
  color: #f5ead6;
}

.login-panel-top {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-height: 44px;
  z-index: 3;
}

.login-panel-lang {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.login-panel-body {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding-top: 8px;
}

.login-panel-head {
  margin-bottom: 24px;
  text-align: left;
}

.login-panel-head h1 {
  margin: 0 0 8px;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: clamp(32px, 3.6vw, 42px);
  font-weight: 400;
  color: #f5c842;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.login-panel-head p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(245, 234, 214, 0.55);
}

.login-error {
  margin: 0 0 16px;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-page .field-label {
  display: none;
}

.field-control {
  position: relative;
}

.field-control svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: rgba(245, 234, 214, 0.38);
  pointer-events: none;
}

.field-control input {
  width: 100%;
  padding: 15px 16px 15px 44px;
  border-radius: 12px;
  border: 1px solid rgba(212, 160, 32, 0.22);
  background: rgba(0, 0, 0, 0.38);
  color: #f5ead6;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

.field-control input::placeholder {
  color: rgba(245, 234, 214, 0.28);
}

.field-control input:focus {
  border-color: rgba(232, 195, 90, 0.7);
  box-shadow: 0 0 0 4px rgba(212, 160, 32, 0.16);
  background: rgba(0, 0, 0, 0.5);
}

.login-ref-block {
  margin-top: 12px;
  text-align: right;
}

.login-page .toggle-ref {
  border: 0;
  background: none;
  padding: 0;
  font-size: 13px;
  color: #d4a020;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.login-page .toggle-ref:hover {
  text-decoration: underline;
}

.login-page #ref-container {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.2s ease,
    margin 0.2s ease;
  text-align: left;
}

.login-page #ref-container.active {
  max-height: 120px;
  opacity: 1;
  margin-top: 10px;
}

.login-submit {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.login-captcha-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.login-captcha-wrap .field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 195, 90, 0.72);
}

.login-captcha {
  display: flex;
  justify-content: flex-start;
  overflow: visible;
  min-height: 78px;
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2a1c08;
  background: linear-gradient(90deg, #f0d078 0%, #d4a020 55%, #b8860b 100%);
  box-shadow:
    0 14px 30px rgba(212, 160, 32, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition:
    filter 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.btn-login:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(212, 160, 32, 0.34);
}

.btn-login:active {
  transform: none;
  filter: brightness(0.98);
}

.login-panel-foot {
  margin-top: 22px;
  font-size: 13px;
  color: rgba(245, 234, 214, 0.45);
  line-height: 1.5;
  text-align: center;
}

.login-panel-foot a {
  color: #d4a020;
  font-weight: 700;
  text-decoration: none;
}

.login-panel-foot a:hover {
  text-decoration: underline;
}

.login-legal {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(245, 234, 214, 0.38);
  line-height: 1.45;
  max-width: 42em;
  padding: 0 8px;
}

.login-page .error-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.28);
  color: #f87171;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}

.login-page .error-box svg {
  flex-shrink: 0;
  margin-top: 2px;
}

@media (max-width: 980px) {
  .login-frame {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-visual {
    min-height: 280px;
    padding: 22px 22px 26px;
    clip-path: none;
  }

  .login-visual-foot {
    display: none;
  }

  .login-panel {
    margin-left: 0;
    padding: 72px 28px 32px;
    border-top: 1px solid rgba(212, 160, 32, 0.14);
    background: linear-gradient(180deg, #1a140c 0%, #0e0a07 100%);
  }

  .login-panel-top {
    top: 0;
    right: 0;
  }
}

@media (max-width: 520px) {
  .login-page {
    padding: 12px 10px 18px;
  }

  .login-frame {
    border-radius: 20px;
  }

  .login-visual {
    min-height: 220px;
    padding: 18px 16px 20px;
  }

  .login-visual-brand strong {
    font-size: 20px;
  }
  .login-visual-pill {
    display: none;
  }

  .login-panel {
    padding: 68px 18px 26px;
  }

  .login-panel-top {
    top: 0;
    right: 0;
  }

  .login-panel-body {
    padding-top: 0;
  }

  .login-captcha {
    transform: scale(0.88);
    transform-origin: left top;
  }
}
