/* ============================================
   Auth — Split-screen layout
   ============================================ */

.auth-wrapper {
  display: flex;
  position: fixed;
  inset: 0;
  background: var(--azul-oscuro);
}

/* Panel izquierdo — formulario */
.auth-left {
  flex: 1 1 0;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 3rem 3.5rem;
  background: #fff;
  overflow-y: auto;
}

/* Spacers que se achican a 0 cuando el contenido desborda,
   permitiendo scroll hasta el tope sin cortar el inicio. */
.auth-left::before,
.auth-left::after {
  content: '';
  flex: 1 1 0;
  min-height: 0;
}

/* Panel derecho — marca */
.auth-right {
  flex: 1 1 0;
  min-height: 0;
  box-sizing: border-box;
  background: var(--azul-oscuro);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.auth-right-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--azul-gazapo) 0%, var(--azul-oscuro) 100%);
  z-index: 0;
}

.auth-right-content {
  position: relative;
  z-index: 1;
}

.auth-right-logo {
  position: absolute;
  top: 2.5rem;
  left: 3rem;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-family);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.auth-right-logo img {
  height: 32px;
}

.auth-right-tagline {
  color: #fff;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  font-family: var(--font-family);
}

.auth-right-tagline span {
  color: var(--coral);
}

.auth-right-sub {
  color: var(--texto-claro-sec);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 340px;
  font-family: var(--font-family);
}

/* Tabs de rol */
.auth-role-tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 2rem;
  gap: 2px;
}

.auth-role-tab {
  flex: 1;
  padding: 0.55rem 1rem;
  text-align: center;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gris-oscuro);
  transition: all 0.2s;
  font-family: var(--font-family);
}

.auth-role-tab.active {
  background: var(--azul-gazapo);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.auth-role-tab:not(.active):hover {
  background: #e5e7eb;
  color: var(--azul-gazapo);
}

/* Encabezado del formulario */
.auth-form-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--coral);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
  font-family: var(--font-family);
}

.auth-header h2 {
  color: var(--azul-gazapo);
  font-family: var(--font-family);
  font-weight: 800;
  margin-bottom: 0.4rem;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.auth-header p {
  color: var(--gris-claro);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
  font-family: var(--font-family);
}

/* Campos del formulario */
.form-group {
  margin-bottom: 1.1rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--azul-gazapo);
  margin-bottom: 0.4rem;
  font-family: var(--font-family);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--bordes);
  font-size: 0.9rem;
  font-family: var(--font-family);
  background: #fff;
  transition: all 0.2s;
  box-sizing: border-box;
  color: var(--texto-primario);
}

.form-control:focus {
  outline: none;
  border-color: var(--azul-gazapo);
  box-shadow: 0 0 0 3px rgba(0, 77, 101, 0.1);
}

.form-control::placeholder {
  color: #c4c4c4;
}

/* Link olvidé contraseña */
.auth-forgot {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  color: var(--gris-oscuro);
  text-decoration: none;
  margin-top: -0.5rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-family);
}

.auth-forgot:hover {
  color: var(--coral);
  text-decoration: underline;
}

/* Botón principal */
.btn-auth {
  width: 100%;
  background: var(--coral);
  color: #fff;
  border: none;
  padding: 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 0.25rem;
  letter-spacing: 0.01em;
}

.btn-auth:hover {
  background: #e55a38;
  transform: translateY(-1px);
}

.btn-auth:active {
  transform: translateY(0);
}

/* Separador "o" */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--gris-claro);
  font-size: 0.8rem;
  font-family: var(--font-family);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bordes);
}

/* Botón outline (crear cuenta) */
.btn-auth-outline {
  width: 100%;
  background: transparent;
  color: var(--azul-gazapo);
  border: 1.5px solid var(--bordes);
  padding: 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  display: block;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.btn-auth-outline:hover {
  border-color: var(--azul-gazapo);
  background: #f0f7fa;
}

/* Texto inferior */
.auth-footer-text {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--gris-oscuro);
  font-family: var(--font-family);
}

.auth-footer-text a {
  color: var(--coral);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer-text a:hover {
  text-decoration: underline;
}

/* Error messages */
.auth-errors {
  background: var(--error-bg);
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--error);
  font-family: var(--font-family);
}

.auth-errors ul {
  margin: 0;
  padding-left: 1.2rem;
}

/* Toast alert */
.toast-alert {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: var(--azul-oscuro);
  border-left: 4px solid var(--coral);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-elevated);
  z-index: 9999;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.4s ease;
  font-family: var(--font-family);
}

.toast-alert.show {
  opacity: 1;
  transform: translateX(0);
}

/* Responsive */
@media (max-width: 768px) {
  .auth-wrapper {
    flex-direction: column;
    overflow-y: auto;
  }

  .auth-left {
    flex: none;
    min-height: 0;
    padding: 2rem 1.5rem;
    overflow-y: visible;
  }

  .auth-right {
    display: none;
  }

  .auth-header h2 {
    font-size: 1.5rem;
  }

  .form-control {
    font-size: 16px;
  }

  .btn-auth {
    min-height: 44px;
  }

  .toast-alert {
    top: 1rem;
    right: 0.5rem;
    left: 0.5rem;
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
  }
}
