/*Proyecto: SIGMAT - Residencia Profesional
 Autoras: Abi & Yire*/

@font-face {
  font-family: 'BricolajeGrotesc';
  src: url('/fonts/BricolajeGrotesc-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'CanvaSansCustom';
  src: url('/fonts/CanvaSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/*Variables globales*/

:root {
  --verde: #82b48e;
  --verde-pastel: #bfe0d1;
  --celeste: #e5edf9;
  --azul-oscuro: #033653;
  --azul-intermedio: #0c3e52;
  --blanco: #ffffff;
  --negro: #000000;
  --rojo: #de3b38;
  --letras-azul: #3871c1;
  --gris-letras: #8a8a8a;
  --celeste-boton-pdf: #1f668f;
  --celeste-claro-botones: #b0ddea;
  --linea-gris-claro: #e8e8e8;
  --color-inputs: #f7f5f5;
  --shadow-1: 0 6px 14px rgba(3, 54, 83, 0.06);
}

/*Estilos generales y principales*/

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--celeste);
  color: var(--azul-oscuro);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.bg-celeste-100 {
  background-color: var(--celeste) !important;
}

/*Cards*/

.card {
  border-radius: 28px;
  overflow: visible;
  min-height: 80vh;
  display: flex;
  max-width: 100%;
  background: transparent;
}

.card>.row {
  flex: 1;
  display: flex;
  align-items: stretch;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 28px;
}

.left-hero,
.right-forms {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Efecto flip */

#card {
  perspective: 1000px;
  position: relative;
}

.forms-wrap {
  transform-style: preserve-3d;
  transition: transform 0.6s ease-in-out;
  width: 100%;
  height: 100%;
}

#card.flipped .forms-wrap {
  transform: rotateY(180deg);
}

#loginPanel,
#registerPanel {
  backface-visibility: hidden;
  transform-style: preserve-3d;
  width: 100%;
  height: 100%;
}

#loginPanel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
}

#registerPanel {
  transform: rotateY(180deg);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
  overflow-y: hidden;
}

/* ALINEACIÓN DEL REGISTRO A LA IZQUIERDA */
#registerPanel h2.display-6,
#registerPanel p {
  text-align: left;
  width: 100%;
  align-self: flex-start; /* Alinear a la izquierda dentro del flex container */
}

#registerPanel form {
  width: 100%;
}

#card.flipped #loginPanel {
  opacity: 0;
  pointer-events: none;
}

#card.flipped #registerPanel {
  opacity: 1;
  pointer-events: auto;
}

/* LADO IZQUIERDO - LOGO */

.left-hero {
  background: linear-gradient(180deg, var(--blanco), rgba(255, 255, 255, 0.96));
  border-top-left-radius: 28px;
  border-bottom-left-radius: 28px;
  min-height: 360px;
  position: relative;
  padding: 2rem;
  overflow: visible !important;
}

.left-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: 0;
  width: 50px;
  height: 100%;
  background: var(--celeste);
  border-radius: 0;
  pointer-events: none;
  z-index: 2;
}

/* MARCA DE AGUA - CONFIGURACIÓN PRINCIPAL */
.left-hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 33%; /* POSICIÓN FIJA A LA IZQUIERDA */
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  max-width: 450px;
  background-image: url('/img/logotecnm.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.95; /* OPACIDAD ALTA */
  z-index: 0;
  pointer-events: none;
}

/* Marca de agua con IMG (oculta, usamos ::before) */
.watermark-tecnm {
  display: none;
}

.watermark-tecnm img {
  display: none;
}

/* Logo SIGMAT */
.hero-inner {
  position: relative;
  z-index: 1;
}

.logo-box img {
  max-width: 100%;
  width: 100%;
  max-width: 520px;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(3, 54, 83, 0.06));
  transition: transform .9s cubic-bezier(.2, .9, .25, 1);
}

.logo-box img:hover {
  transform: translateY(-6px) rotate(-1deg);
}

/* LADO DERECHO - FORMULARIOS */

.right-forms {
  background: var(--celeste);
  padding: 2rem;
  border-top-right-radius: 28px;
  border-bottom-right-radius: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-panel {
  transition: transform .45s cubic-bezier(.2, .9, .25, 1), opacity .35s;
  width: 100%;
  height: auto;
}

.form-panel:not(.active) {
  transform: translateX(40px) scale(.995);
  opacity: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.form-panel.active {
  transform: translateX(0);
  opacity: 1;
  height: auto;
  pointer-events: auto;
}

.display-6 {
  color: var(--azul-oscuro);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
}

.form-panel h2.display-6::after {
  content: "";
  display: block;
  width: 68px;
  height: 8px;
  border-radius: 8px;
  margin-top: 8px;
  background: linear-gradient(90deg, var(--verde), rgba(56, 113, 193, 0.18));
}

/* REDUCIR ESPACIADO EN FORMULARIO DE REGISTRO */
#registerPanel .mb-3,
#registerPanel .mb-2,
#registerPanel .mb-md-3 {
  margin-bottom: 0.5rem !important;
}

#registerPanel .mb-4,
#registerPanel .mb-md-4 {
  margin-bottom: 0.75rem !important;
}

#registerPanel p {
  margin-bottom: 0.75rem !important;
}

/* INPUTS MÁS COMPACTOS EN REGISTRO */
#registerPanel .custom-input {
  padding: 8px 12px !important;
  font-size: 0.9rem;
}

#registerPanel .input-with-icon .form-label {
  font-size: 0.85rem;
  margin-bottom: 4px;
}

/* INPUTS */

.custom-input {
  background: linear-gradient(180deg, var(--color-inputs), var(--blanco));
  border: 1px solid var(--linea-gris-claro);
  border-radius: 14px;
  padding: 12px 14px;
  transition: box-shadow .18s, transform .12s, border-color .12s;
  outline: none;
  font-size: 0.95rem;
  width: 100%;
}

.custom-input:focus {
  border-color: var(--verde);
  box-shadow: 0 10px 20px rgba(3, 54, 83, 0.06), 0 6px 0 rgba(130, 180, 142, 0.12);
  transform: translateY(-2px);
}

.custom-input:focus-visible {
  outline: 3px solid rgba(130, 180, 142, 0.14);
  outline-offset: 2px;
}

.input-with-icon .form-label {
  display: block;
  font-size: 0.9rem;
  color: var(--gris-letras);
  margin-bottom: 6px;
}

/* BOTONES */

.btn-primary-custom {
  background: linear-gradient(180deg, var(--verde));
  border: none;
  color: var(--azul-intermedio);
  border-radius: 14px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  box-shadow: 0 10px 18px rgba(3, 54, 83, 0.08);
  transition: transform .12s ease, box-shadow .12s ease;
  margin-top: 10px;
  width: 100%;
}

.btn-primary-custom:hover {
  background: linear-gradient(180deg, var(--azul-intermedio));
  transform: translateY(-3px);
  color: var(--blanco);
  box-shadow: 0 18px 30px rgba(3, 54, 83, 0.12);
}

/* SELECT */

.custom-input option {
  padding: 10px;
  border-radius: 28px;
  background-color: var(--celeste);
  color: var(--azul-oscuro);
  transition: background 0.3s ease;
}

.custom-input option:hover {
  background-color: var(--verde-pastel);
}

/* LINKS PARTE INFERIOR */

/* LINKS PARTE INFERIOR */

.links-login {
  display: flex;
  flex-direction: row; /* CAMBIO: de column a row para que estén en línea */
  justify-content: space-between; /* ESPACIO ENTRE LOS ENLACES */
  gap: 1rem; /* ESPACIO ENTRE ELLOS */
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap; /* PERMITE QUE SE APILEN EN MÓVILES MUY PEQUEÑOS */
}

.links-login a {
  text-decoration: none;
  color: var(--azul-intermedio);
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  text-align: center;
}

.links-login a:hover {
  text-decoration: underline;
}

.link-primary {
  color: var(--azul-oscuro);
  text-decoration: underline;
}

.link-secondary {
  color: var(--gris-letras);
  text-decoration: none;
}

.text-secondary {
  color: var(--gris-letras);
}

.bi {
  font-size: 1.02rem;
  vertical-align: -0.08em;
  color: var(--azul-oscuro);
}

/* FOOTER CON DERECHOS DE AUTOR */

.footer-copyright {
  padding: 1rem 0;
  width: 100%;
}

.copyright-text {
  color: rgb(182, 182, 182);
  font-size: clamp(0.7rem, 2vw, 1rem);
  line-height: 1.5;
  text-align: center;
  padding: 0 1rem;
  word-wrap: break-word;
  white-space: normal;
}

/* ============================================
   MEDIA QUERIES - RESPONSIVE
   ============================================ */

/* TABLETS (768px - 991px) */
@media (max-width: 991.98px) {
  .card {
    min-height: 80vh;
    border-radius: 24px;
  }

  .card>.row {
    border-radius: 24px;
  }

  .right-forms {
    padding: 1.5rem;
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
  }

  .left-hero {
    padding: 1.5rem;
    min-height: 280px;
    border-top-left-radius: 24px;
    border-bottom-left-radius: 24px;
    overflow: visible !important;
  }

  /* MARCA DE AGUA EN TABLETS - MISMA CONFIGURACIÓN */
  .left-hero::before {
    left: 33%; /* MANTENER POSICIÓN */
    max-width: 380px;
    opacity: 0.95; /* MANTENER OPACIDAD */
  }

  .logo-box img {
    max-width: 350px;
  }

  #registerPanel {
    padding: 1rem;
    overflow-y: hidden;
  }

  #registerPanel .custom-input {
    padding: 7px 11px !important;
    font-size: 0.85rem;
  }

  #registerPanel .display-6 {
    font-size: 1.4rem;
  }
}

/* MÓVILES (hasta 767px) */
@media (max-width: 767.98px) {
  body {
    padding: 0;
  }

  main.container-fluid {
    padding: 0.5rem !important;
  }

  .card {
    border-radius: 16px;
    min-height: 80vh;
  }

  .card>.row {
    border-radius: 16px;
  }

  .left-hero::after {
    display: none;
  }

  .left-hero {
    order: 1;
    min-height: 200px;
    padding: 1.5rem;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    overflow: visible !important;
  }

  /* MARCA DE AGUA EN MÓVILES - MISMA CONFIGURACIÓN */
  .left-hero::before {
    left: 33%; /* MANTENER POSICIÓN */
    max-width: 320px;
    opacity: 0.95; /* MANTENER OPACIDAD */
  }

  .right-forms {
    order: 2;
    padding: 1rem;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    background: var(--celeste);
  }

  .logo-box img {
    max-width: 280px;
  }

  #registerPanel {
    padding: 0.75rem;
    justify-content: center;
    overflow-y: hidden;
  }

  #registerPanel .display-6 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
  }

  #registerPanel .custom-input {
    padding: 6px 10px !important;
    font-size: 0.8rem;
  }

  #registerPanel .input-with-icon .form-label {
    font-size: 0.8rem;
    margin-bottom: 3px;
  }

  #registerPanel .btn-primary-custom {
    padding: 8px 14px;
    margin-top: 8px;
  }

  #registerPanel .mb-3,
  #registerPanel .mb-2 {
    margin-bottom: 0.4rem !important;
  }

  .copyright-text {
    font-size: 0.7rem;
  }
}

/* MÓVILES PEQUEÑOS (hasta 576px) */
@media (max-width: 575.98px) {
  .card {
    border-radius: 12px;
    min-height: 80vh;
  }

  .card>.row {
    border-radius: 12px;
  }

  .left-hero {
    min-height: 160px;
    padding: 1rem;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    overflow: visible !important;
  }

  /* MARCA DE AGUA EN MÓVILES PEQUEÑOS - MISMA CONFIGURACIÓN */
  .left-hero::before {
    left: 33%; /* MANTENER POSICIÓN */
    max-width: 260px;
    opacity: 0.95; /* MANTENER OPACIDAD */
  }

  .right-forms {
    padding: 0.75rem;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
  }

  .logo-box img {
    max-width: 220px;
  }

  #registerPanel {
    padding: 0.5rem;
  }

  #registerPanel .display-6 {
    font-size: 1.2rem;
  }

  #registerPanel .custom-input {
    padding: 5px 9px !important;
    font-size: 0.75rem;
  }

  #registerPanel .input-with-icon .form-label {
    font-size: 0.75rem;
  }

  .copyright-text {
    font-size: 0.65rem;
  }
}

/* PANTALLAS EXTRA PEQUEÑAS (menos de 400px) */
@media (max-width: 399.98px) {
  .logo-box img {
    max-width: 180px;
  }

  /* MARCA DE AGUA EN EXTRA PEQUEÑOS - MISMA CONFIGURACIÓN */
  .left-hero::before {
    left: 33%; /* MANTENER POSICIÓN */
    max-width: 220px;
    opacity: 0.95; /* MANTENER OPACIDAD */
  }

  #registerPanel .display-6 {
    font-size: 1.1rem;
  }

  #registerPanel .custom-input {
    font-size: 0.7rem;
    padding: 4px 8px !important;
  }

  .copyright-text {
    font-size: 0.6rem;
  }
}

/* ORIENTACIÓN HORIZONTAL (LANDSCAPE) EN MÓVILES */
@media (max-height: 600px) and (orientation: landscape) {
  .card {
    min-height: auto;
  }

  .left-hero {
    min-height: 140px;
    overflow: visible !important;
  }

  /* MARCA DE AGUA EN LANDSCAPE - MISMA CONFIGURACIÓN */
  .left-hero::before {
    left: 33%; /* MANTENER POSICIÓN */
    max-width: 200px;
    opacity: 0.95; /* MANTENER OPACIDAD */
  }

  #registerPanel,
  #loginPanel {
    justify-content: center;
    overflow-y: hidden;
    padding: 0.5rem;
  }

  .logo-box img {
    max-width: 180px;
  }
}

/* MONITORES GRANDES (1920px+) */
@media (min-width: 1920px) {
  .card {
    max-width: 1400px;
    margin: 0 auto;
  }

  .logo-box img {
    max-width: 520px;
  }

  /* MARCA DE AGUA EN MONITORES GRANDES - MISMA CONFIGURACIÓN */
  .left-hero::before {
    left: 33%; /* MANTENER POSICIÓN */
    max-width: 500px;
    opacity: 0.95; /* MANTENER OPACIDAD */
  }
}