/* 
  Estilos generales para login y registro 
  Soporte para modo claro y oscuro, botones, formularios, y campos de contraseña

  Stiles for login and register
  Support for light and dark mode, buttons, forms, and password fields
*/

/* ------------------------- */
/* VARIABLES DE COLOR | COLOR VARIABLES */
/* Modo claro | Light mode */
:root {
  --bg: #f2f2f2;
  --text: #1e1e1e;
  --primary: #6c63ff;
  --accent: #ff6584;
  --input-bg: #fff;
  --input-border: #ccc;
  --button-bg: var(--primary);
  --button-text: #fff;
  --shadow: rgba(0, 0, 0, 0.1);
}

/* Modo oscuro | Dark mode */
body.dark {
  --bg: #1e1e2f;
  --text: #f5f5f5;
  --input-bg: #2c2c3a;
  --input-border: #444;
  --button-bg: #7f5af0;
  --shadow: rgba(255, 255, 255, 0.05);
}

/* ------------------------- */
/* ESTILOS GENERALES DEL BODY | GENERAL BODY STYLES */
body {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* ------------------------- */
/* BOTONES EN LA CABECERA | HEADER BUTTONS */
.header-buttons {
  position: absolute;
  top: 20px;
  right: 20px;
}

/* ------------------------- */
/* BOTONES GENERALES | GENERAL BUTTONS */
button, .button-login, .button-register, #toggle-view {
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  padding: 0.7em 1.5em;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 10px var(--shadow);
  transition: transform 0.2s ease, background 0.3s;
  font-weight: bold;
  text-align: center;
  margin: 0.5em;
}

/* Efecto hover para botones | Hover effect for buttons */
button:hover, .button-login:hover, .button-register:hover, #toggle-view:hover {
  transform: scale(1.05);
  background: var(--accent);
}

/* ------------------------- */
/* CONTENEDOR PRINCIPAL | MAIN CONTAINER */
section {
  width: 100%;
  max-width: 450px;
  padding: 2em;
  background: linear-gradient(135deg, var(--bg), var(--input-bg));
  border-radius: 20px;
  box-shadow: 0 10px 30px var(--shadow);
  backdrop-filter: blur(10px);
}

/* ------------------------- */
/* CONTENEDOR LOGIN Y REGISTRO | LOGIN AND REGISTER CONTAINER */
.conteiner-login-register {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  min-height: 300px; 
}

/* ------------------------- */
/* SECCIONES LOGIN Y REGISTER | LOGIN AND REGISTER SECTIONS */
.login, .register {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  position: absolute;
  width: 100%;
}

.login.active, .register.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}

/* ------------------------- */
/* TÍTULOS DE SECCIONES | SECTION TITLES */
h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 700;
}

/* ------------------------- */
/* FORMULARIOS | FORMS */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ------------------------- */
/* CAMPOS DE ENTRADA | INPUT FIELDS */
input[type="text"], input[type="password"], input[type="email"] {
  padding: 0.8em;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  transition: border 0.2s;
}

input:focus {
  border-color: var(--accent);
  outline: none;
}

/* ------------------------- */
/* BOTONES INFERIORES | LOWER BUTTONS */
.buttons {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

/* ------------------------- */
/* CAMPO DE CONTRASEÑA CON ICONO | PASSWORD FIELD WITH ICON */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  width: 100%;
  padding-right: 2.5em;
}

/* ------------------------- */
/* ICONO DE MOSTRAR CONTRASEÑA | SHOW PASSWORD ICON */
.toggle-password {
  position: absolute;
  right: 0.8em;
  cursor: pointer;
  user-select: none;
  font-size: 1.2em;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.toggle-password:hover {
  opacity: 1;
}

/* ------------------------- */
/* RESPONSIVE: MÓVILES | MOBILE */
@media (max-width: 600px) {
  section {
    padding: 1.5em;
  }

  button, .button-login, .button-register, #toggle-view {
    padding: 0.5em 1em;
    font-size: 0.9rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

/* ------------------------- */
/* RESPONSIVE: TABLETAS | TABLETS */
@media (max-width: 900px) {
  section {
    padding: 1.5em;
  }

  button, .button-login, .button-register, #toggle-view {
    padding: 0.5em 1em;
    font-size: 0.9rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

/* ------------------------- */
/* RESPONSIVE: ESCRITORIOS | DESKTOP */
@media (min-width: 901px) {
  section {
    padding: 2em;
  }

  button, .button-login, .button-register, #toggle-view {
    padding: 0.7em 1.5em;
    font-size: 1rem;
  }

  h2 {
    font-size: 2rem;
  }
}

/* ------------------------- */
/* RESPONSIVE: GRANDES ESCRITORIOS | LARGE DESKTOPS */
@media (min-width: 1200px) {
  section {
    padding: 2.5em;
  }

  button, .button-login, .button-register, #toggle-view {
    padding: 0.8em 1.8em;
    font-size: 1.1rem;
  }

  h2 {
    font-size: 2.5rem;
  }
}