/* Base styling */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(5px);
}

/* Ajuste para tema claro en overlay */
:global(.light-theme) .overlay {
  background-color: rgba(0, 0, 0, 0.5);
}

.show {
  opacity: 1;
  visibility: visible;
}

.hide {
  opacity: 0;
  visibility: hidden;
}


.registroContainer {
  width: 95%;
  max-width: 1100px;
  max-height: 750px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  animation: slideIn 0.4s ease forwards;
  background-color: #080808;
  position: relative;
}

:global(.light-theme) .registroContainer {
  background-color: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.registroSplit {
  display: flex;
  height: 100%;
  width: 100%;
}

/* Image side styling */
.registroImage {
  position: relative;
  width: 45%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bgImage {
  object-fit: cover;
  object-position: center;
  z-index: 1;
}

.imageCover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10%;
  background: linear-gradient(to bottom, #0000001e, #004bb3);
  z-index: 2;
  text-align: center;
}

:global(.light-theme) .imageCover {
  background: linear-gradient(to bottom, #0000001e, #004bb3);
}

.welcomeText {
  color: #ffffff;
  font-size: clamp(1.5rem, 2.5vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 1vw 0;
  line-height: 1.2;
}

:global(.light-theme) .welcomeText {
  color: #ffffff;
}

.welcomeSubtext {
  color: #ffffff;
  font-size: clamp(0.8rem, 1.2vw, 0.9rem);
  line-height: 1.5;
  max-width: 80%;
}

:global(.light-theme) .welcomeSubtext {
  color: #ffffff;
}

/* Form side styling */
.registroContent {
  width: 55%;
  padding: 5%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #006aff transparent;
}

.registroContent::-webkit-scrollbar {
  width: 6px;
}

.registroContent::-webkit-scrollbar-thumb {
  background-color: #006aff;
  border-radius: 6px;
}

.registroContent::-webkit-scrollbar-track {
  background: transparent;
}

.registroHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8%;
  padding-bottom: 5%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

:global(.light-theme) .registroHeader {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.registroHeader h2 {
  color: #ffffff;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0;
}

:global(.light-theme) .registroHeader h2 {
  color: #1b1b24;
}

/* Buttons and interactive elements */
.closeButton {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.closeButton:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.errorMessage {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  background-color: rgba(255, 77, 106, 0.1);
  border-left: 3px solid #ff4d6a;
  border-radius: 4px;
  color: #ff4d6a;
  font-size: 14px;
}

.successMessage {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  background-color: rgba(30, 215, 96, 0.1);
  border-left: 3px solid #1ED760;
  border-radius: 4px;
  color: #1ED760;
  font-size: 14px;
}

/* Form elements */
.registroForm, .verificationForm {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nameFields {
  display: flex;
  gap: 16px;
}

.nameFields .inputGroup {
  flex: 1;
}

.inputGroup {
  margin-bottom: 5px;
}

.inputGroup label {
  display: block;
  color: #ffffff;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
}

:global(.light-theme) .inputGroup label {
  color: #1b1b24;
}

.inputWithIcon {
  position: relative;
  display: flex;
  align-items: center;
}

.inputIcon {
  position: absolute;
  left: 12px;
  color: #b3b3b3;
  pointer-events: none;
}

:global(.light-theme) .inputIcon {
  color: #6e6e7a;
}

.inputWithIcon input {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 12px 12px 40px;
  color: #ffffff;
  font-size: 16px;
  transition: all 0.3s ease;
}

:global(.light-theme) .inputWithIcon input {
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #1b1b24;
}

.inputWithIcon input:focus {
  outline: none;
  border-color: #006aff;
  box-shadow: 0 0 0 2px rgba(0, 106, 255, 0.5);
}

.inputWithIcon input:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.3);
}

:global(.light-theme) .inputWithIcon input:hover:not(:focus) {
  border-color: rgba(0, 0, 0, 0.3);
}

.inputWithIcon input::placeholder {
  color: #b3b3b3;
  opacity: 0.7;
}

:global(.light-theme) .inputWithIcon input::placeholder {
  color: #6e6e7a;
  opacity: 0.7;
}

.togglePassword {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #b3b3b3;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

:global(.light-theme) .togglePassword {
  color: #6e6e7a;
}

.togglePassword:hover {
  color: #ffffff;
}

:global(.light-theme) .togglePassword:hover {
  color: #1b1b24;
}

.togglePassword:focus {
  outline: 2px solid rgba(0, 106, 255, 0.5);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Términos y condiciones */
.terminos {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.terminos input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin: 2px 0 0 0;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

:global(.light-theme) .terminos input[type="checkbox"] {
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.terminos input[type="checkbox"]:checked {
  background-color: #006aff;
  border-color: #006aff;
}

.terminos input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 7px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.terminos input[type="checkbox"]:focus {
  box-shadow: 0 0 0 2px rgba(0, 106, 255, 0.5);
}

.terminos label {
  color: #b3b3b3;
  font-size: 14px;
  line-height: 1.4;
}

:global(.light-theme) .terminos label {
  color: #6e6e7a;
}

.termsLink {
  color: #006aff;
  text-decoration: none;
  transition: all 0.3s ease;
}

.termsLink:hover {
  text-decoration: underline;
  color: #0055cc;
}

/* Primary action button */
.registroButton, .verifyButton {
  width: 100%;
  background-color: #006aff;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.registroButton:hover:not(:disabled),
.verifyButton:hover:not(:disabled) {
  background-color: #0055cc;
  transform: translateY(-2px);
}

.registroButton:active:not(:disabled),
.verifyButton:active:not(:disabled) {
  transform: translateY(0);
}

.registroButton:focus,
.verifyButton:focus {
  outline: 2px solid rgba(0, 106, 255, 0.5);
  outline-offset: 2px;
}

.registroButton:disabled,
.verifyButton:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Optimized loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  position: relative;
  animation: spinner-rotate 1.5s linear infinite;
  will-change: transform;
}

.spinnerBlade {
  position: absolute;
  top: 11px;
  left: 0;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background-color: white;
  transform-origin: 12px 1px;
  will-change: transform, opacity;
}

/* Posiciones para los spinners */
.spinnerBlade:nth-child(1) { transform: rotate(0deg); opacity: 0.9; }
.spinnerBlade:nth-child(2) { transform: rotate(30deg); opacity: 0.8; }
.spinnerBlade:nth-child(3) { transform: rotate(60deg); opacity: 0.7; }
.spinnerBlade:nth-child(4) { transform: rotate(90deg); opacity: 0.6; }
.spinnerBlade:nth-child(5) { transform: rotate(120deg); opacity: 0.5; }
.spinnerBlade:nth-child(6) { transform: rotate(150deg); opacity: 0.4; }
.spinnerBlade:nth-child(7) { transform: rotate(180deg); opacity: 0.3; }
.spinnerBlade:nth-child(8) { transform: rotate(210deg); opacity: 0.2; }
.spinnerBlade:nth-child(9) { transform: rotate(240deg); opacity: 0.3; }
.spinnerBlade:nth-child(10) { transform: rotate(270deg); opacity: 0.4; }
.spinnerBlade:nth-child(11) { transform: rotate(300deg); opacity: 0.5; }
.spinnerBlade:nth-child(12) { transform: rotate(330deg); opacity: 0.6; }

@keyframes spinner-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Divider y social login */
.divider {
  position: relative;
  margin: 5% 0;
  text-align: center;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
}

:global(.light-theme) .divider::before {
  background-color: rgba(0, 0, 0, 0.1);
}

.divider span {
  position: relative;
  background-color: #080808;
  padding: 0 16px;
  color: #b3b3b3;
  font-size: 14px;
}

:global(.light-theme) .divider span {
  background-color: #ffffff;
  color: #6e6e7a;
}

.socialLogin {
  display: flex;
  gap: 16px;
  margin-bottom: 5%;
}

.socialButton {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

:global(.light-theme) .socialButton {
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #1b1b24;
}

.socialButton:hover {
  background-color: #2a2a36;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

:global(.light-theme) .socialButton:hover {
  background-color: #f2f2f5;
  border-color: rgba(0, 0, 0, 0.2);
}

.socialButton:active {
  transform: translateY(0);
}

.socialButton:focus {
  outline: 2px solid rgba(0, 106, 255, 0.5);
  outline-offset: 2px;
}

/* Login prompt */
.loginPrompt {
  margin: 5% 0 0;
  text-align: center;
  color: #b3b3b3;
  font-size: 14px;
}

:global(.light-theme) .loginPrompt {
  color: #6e6e7a;
}

.loginLink {
  background: none;
  border: none;
  color: #006aff;
  cursor: pointer;
  font-weight: 500;
  padding: 0;
  font-size: 14px;
  transition: all 0.3s ease;
}

.loginLink:hover {
  text-decoration: underline;
  color: #0055cc;
}

.loginLink:focus {
  outline: 2px solid rgba(0, 106, 255, 0.5);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Estilos para la verificación */
.verificationForm {
  padding: 0 10px;
}

.verificationIcon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 60px;
  color: #006aff;
}

.verificationText {
  text-align: center;
  margin-bottom: 30px;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.5;
}

:global(.light-theme) .verificationText {
  color: #1b1b24;
}

.verificationText strong {
  color: #006aff;
}

.codeInputContainer {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.verificationInput {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 15px;
  color: #ffffff;
  font-size: 20px;
  width: 100%;
  max-width: 300px;
  text-align: center;
  letter-spacing: 5px;
  transition: all 0.3s ease;
}

:global(.light-theme) .verificationInput {
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #1b1b24;
}

.verificationInput:focus {
  outline: none;
  border-color: #006aff;
  box-shadow: 0 0 0 2px rgba(0, 106, 255, 0.5);
}

.resendContainer {
  text-align: center;
  margin-top: 15px;
  margin-bottom: 20px;
  color: #b3b3b3;
}

:global(.light-theme) .resendContainer {
  color: #6e6e7a;
}

.resendButton {
  background: none;
  border: none;
  color: #006aff;
  cursor: pointer;
  padding: 0;
  margin-left: 5px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.resendButton:hover:not(.disabled) {
  text-decoration: underline;
  color: #0055cc;
}

.resendButton.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  color: #b3b3b3;
}

:global(.light-theme) .resendButton.disabled {
  color: #6e6e7a;
}

.verificationNote {
  text-align: center;
  color: #b3b3b3;
  font-size: 12px;
  margin-top: 20px;
  font-style: italic;
}

:global(.light-theme) .verificationNote {
  color: #6e6e7a;
}

@keyframes slideIn {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Variables personalizadas para colores de tema */
.verificationIcon,
.termsLink,
.loginLink,
.resendButton:not(.disabled) {
  color: #006aff;
}

:global(.light-theme) .verificationIcon,
:global(.light-theme) .termsLink,
:global(.light-theme) .loginLink,
:global(.light-theme) .resendButton:not(.disabled) {
  color: #006aff;
}

.loginButton,
.registroButton,
.verifyButton,
.terminos input[type="checkbox"]:checked {
  background-color: #006aff;
}

.loginButton:hover,
.registroButton:hover:not(:disabled),
.verifyButton:hover:not(:disabled) {
  background-color: #0055cc;
}

/* Media queries */
@media (max-width: 900px) {
  .registroContainer {
    width: 95%;
    max-width: 600px;
    height: auto;
    max-height: 90vh;
  }
  
  .registroSplit {
    flex-direction: column;
  }
  
  .registroImage {
    width: 100%;
    height: 180px;
  }
  
  .registroContent {
    position: relative;
    width: 100%;
    height: auto;
    padding: 6%;
  }
  
  .welcomeText {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
  }
  
  .welcomeSubtext {
    font-size: clamp(0.875rem, 3vw, 1rem);
  }
  
  .nameFields {
    flex-direction: column;
    gap: 10px;
  }
}

/* Optimizaciones para móvil */
@media (max-width: 768px) {
  .registroContainer {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
  
  .overlay {
    padding: 0;
  }
  
  .registroHeader {
    padding-bottom: 4%;
    margin-bottom: 5%;
  }
  
  .socialLogin {
    flex-direction: column;
    gap: 12px;
  }
  
  .socialButton {
    height: 52px;
    font-size: 16px;
  }
  
  .registroButton,
  .verifyButton {
    height: 52px;
    font-size: 16px;
    padding: 0 12px;
  }
  
  .inputWithIcon input {
    padding: 16px 12px 16px 44px;
    font-size: 16px;
    height: 52px;
  }
  
  .inputIcon {
    font-size: 20px;
    left: 14px;
  }
  
  .togglePassword {
    right: 14px;
    padding: 14px 10px;
  }
  
  .terminos input[type="checkbox"] {
    width: 24px;
    height: 24px;
  }
  
  .terminos input[type="checkbox"]:checked::after {
    top: 5px;
    left: 9px;
    width: 5px;
    height: 10px;
  }
  
  .terminos label {
    font-size: 16px;
    padding-top: 2px;
  }
  
  .loginPrompt {
    font-size: 16px;
    margin-top: 20px;
  }
  
  .loginLink {
    font-size: 16px;
    padding: 4px 0;
  }
  
  .registroHeader h2 {
    font-size: 1.75rem;
  }
  
  .closeButton {
    font-size: 2.25rem;
    top: 2%;
    right: 4%;
    padding: 8px;
  }
  
  .verificationInput {
    font-size: 24px;
    padding: 16px;
    height: 64px;
  }
  
  .verificationIcon {
    font-size: 72px;
  }
  
  .resendButton {
    font-size: 16px;
    padding: 4px 8px;
  }
}

@media (max-width: 600px) {
  .registroContainer {
    max-height: 100vh;
    border-radius: 0;
    width: 100%;
    height: 100%;
  }
  
  .overlay {
    padding: 0;
  }
  
  .registroHeader {
    padding-bottom: 4%;
    margin-bottom: 6%;
  }
  
  .socialLogin {
    flex-direction: column;
    gap: 10px;
  }
  
  .registroImage {
    height: 120px;
  }
  
  .welcomeText {
    font-size: clamp(1.125rem, 6vw, 1.5rem);
  }
  
  .welcomeSubtext {
    font-size: clamp(0.875rem, 3.5vw, 1rem);
  }
  
  .registroButton,
  .verifyButton {
    padding: 14px;
    height: 56px;
  }
  
  .inputGroup label {
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .codeInputContainer {
    padding: 0 10%;
  }
}

/* Soporte para preferencia de reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  .registroContainer {
    animation: none;
  }
  
  .registroButton:hover:not(:disabled),
  .verifyButton:hover:not(:disabled),
  .socialButton:hover {
    transform: none;
  }
}