/* === ESTILOS COMPARTIDOS ENTRE PANTALLAS DE AUTENTICACIÓN === */
:root {
  --header-h: 80px;
  --banner-h: 3.5rem;
  --footer-h: 56px;
  --bg--tecnm: #0b1e8a;
  --rojoTec: #b21f2d;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #f5f7fb;
}

body.register-body {
  min-height: 100vh;
}

/* === CABECERA CON LOGOS === */
#auth-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 1050;
  background-color: #fff;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-logo {
  display: block;
  height: auto;
  object-fit: contain;
  transition: opacity 0.3s ease;
  flex-shrink: 0;
}

.logo-sep {
  max-height: clamp(32px, 4vh, 48px);
}

.logo-tecnm,
.logo-itcj {
  max-height: clamp(42px, 5.5vh, 66px);
}

.logo-posgrado {
  max-height: clamp(38px, 5vh, 60px);
}

.header-logos {
  flex-shrink: 0;
}

.brand-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.brand-text {
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  color: var(--rojoTec);
  letter-spacing: 0.08em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* === BANNER DE BIENVENIDA === */
.siiapec-welcome-banner {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 1040;
  background: linear-gradient(135deg, #2c5530 0%, #4a7c59 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border-bottom: 2px solid #1e3a23;
  height: var(--banner-h);
  animation: slideDownSmooth 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.banner-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
}

.banner-text {
  color: #ffffff;
  font-size: clamp(0.875rem, 2.2vw, 1.1rem);
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.025em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  margin: 0;
}

@keyframes slideDownSmooth {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  60% {
    transform: translateY(0);
    opacity: 1;
  }
  75% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* === CONTENEDOR PRINCIPAL === */
#main-content {
  position: fixed;
  top: calc(var(--header-h) + var(--banner-h));
  left: 0;
  right: 0;
  bottom: var(--footer-h);
  background: url("../../assets/images/fondo2.jpg") no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
  overflow-y: auto;
  overflow-x: hidden;
}

.auth-container {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-bg {
  width: 100%;
  max-width: 28rem;
  padding: 1.25rem;
}

/* === TARJETA === */
.card {
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border: none;
  border-top: 5px solid #4a7c59 !important;
  border-radius: 1rem;
  backdrop-filter: blur(10px);
}

.card-body {
  padding: 2rem;
}

/* === FORMULARIO === */
.form-control {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #ced4da;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--bg--tecnm);
  box-shadow: 0 0 0 0.2rem rgba(11, 30, 138, 0.25);
  outline: none;
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #495057;
}

.btn {
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-success {
  background-color: #28a745;
  border-color: #28a745;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
  background-color: #218838;
  border-color: #1e7e34;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-primary {
  background-color: var(--bg--tecnm);
  border-color: var(--bg--tecnm);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #0a1a7a;
  border-color: #0a1a7a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(11, 30, 138, 0.3);
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-h);
  background: #212529;
  color: #fff;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#main-content::-webkit-scrollbar {
  width: 8px;
}

#main-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

#main-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

#main-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

a {
  color: var(--bg--tecnm);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #0a1a7a;
  text-decoration: underline;
}

.alert {
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.siiapec-welcome-banner,
.auth-container,
.card {
  will-change: auto;
}

.siiapec-welcome-banner {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* === RESPONSIVE === */
@media (max-width: 991.98px) {
  :root {
    --header-h: 72px;
    --banner-h: 3.2rem;
  }

  .brand-text {
    font-size: clamp(1.8rem, 5vw, 3rem);
  }

  .banner-text {
    font-size: clamp(0.8rem, 2.5vw, 1rem);
  }

  .auth-container {
    padding: 2rem 0.75rem;
  }

  .card-body {
    padding: 1.75rem;
  }
}

@media (max-width: 767.98px) {
  :root {
    --header-h: 70px;
    --banner-h: 3rem;
  }

  .logo-sep,
  .logo-posgrado {
    display: none !important;
  }

  .banner-text {
    font-size: clamp(0.75rem, 3vw, 0.95rem);
    line-height: 1.2;
  }

  .auth-container {
    padding: 1.5rem 0.75rem;
  }

  .card-body {
    padding: 1.5rem;
  }

  .brand-text {
    font-size: clamp(1.6rem, 6vw, 2.5rem);
  }
}

@media (max-width: 575.98px) {
  :root {
    --header-h: 64px;
    --banner-h: 2.8rem;
  }

  .header-logos {
    display: none !important;
  }

  #auth-header .d-flex {
    justify-content: center !important;
  }

  .brand-container {
    margin: 0 auto;
  }

  .banner-text {
    font-size: clamp(0.7rem, 3.5vw, 0.85rem);
  }

  .auth-bg {
    max-width: 100%;
    padding: 0.75rem;
  }

  .card-body {
    padding: 1.25rem;
  }

  .btn {
    padding: 0.65rem 1.25rem;
  }

  .auth-container {
    padding: 1.25rem 0.5rem;
  }
}

@media (max-width: 479.98px) {
  :root {
    --banner-h: 2.5rem;
  }

  .banner-text {
    font-size: 0.7rem;
    letter-spacing: 0.01em;
  }

  .card {
    border-radius: 0.75rem;
  }

  .card-body {
    padding: 1rem;
  }
}

.form-control:focus,
.btn:focus {
  outline: 2px solid var(--bg--tecnm);
  outline-offset: 2px;
}
