/* ==========================================================================
   INTERFAZ DE ACCESO PREMUM (auth.css)
   ========================================================================== */

.auth-body {
  background-color: #f8fafc !important; /* Un gris/azul más limpio y tecnológico */
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

/* Tarjeta */
.auth-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.05),
    0 8px 10px -6px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 600px;
  padding: 3rem 3.5rem;
  box-sizing: border-box;
}

/* Cabecera de la tarjeta */
.auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  color: #0f172a;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 0.5rem 0;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-logo span.azul {
  color: var(--brand);
}

.auth-subtitle {
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0;
}

/* Secciones internas de texto */
.auth-view-header {
  text-align: left; /* Alineado a la izquierda da un toque más "app" */
  margin-bottom: 1.75rem;
}

.auth-view-header h2 {
  font-size: 1.25rem;
  color: #0f172a;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
}

.auth-view-header p {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

/* Formularios y grupos */
.auth-card-content form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

.label-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Inputs estilizados (Menos toscos) */
.auth-card-content input[type="email"],
.auth-card-content input[type="password"],
.auth-card-content input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.85rem; /* Reducido para estilizar el alto */
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.925rem;
  color: #0f172a;
  background-color: #fff;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.auth-card-content input:focus {
  outline: none;
  border-color: #0056b3;
  box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.1);
}

/* Botón de acción */
.auth-card-content button.btn-auth-submit,
button.btn-auth-submit {
  display: block;
  width: 100%;
  background-color: #0056b3 !important;
  color: #ffffff !important;
  border: none !important;
  padding: 0.75rem 1rem !important; /* Proporción equilibrada */
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    transform 0.1s ease;
  margin-top: 0.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.auth-card-content button.btn-auth-submit:hover {
  background-color: #004494 !important;
}

.auth-card-content button.btn-auth-submit:active {
  transform: scale(0.98); /* Pequeño feedback físico al hacer clic */
}

.btn-confirm {
  display: inline-block;
  margin: 20px auto;
  padding: 0.75rem;
  text-decoration: none;
  background: #0056b3;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
}

/* Enlaces */
.auth-link,
.auth-link-sm {
  color: #0056b3;
  text-decoration: none;
  font-weight: 500;
}

.auth-link-sm {
  font-size: 0.8rem;
}

.auth-link:hover,
.auth-link-sm:hover {
  color: #004494;
  text-decoration: underline;
}

.auth-view-footer {
  text-align: center;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.85rem;
  color: #64748b;
}

/* Footer global del layout */
.auth-footer {
  text-align: center;
  padding: 1.5rem;
  color: #94a3b8;
  font-size: 0.8rem;
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
}

/* Soporte para layouts de campos dobles en formularios de acceso */
.form-row-2 {
  display: flex;
  gap: 1rem;
}

.form-row-2 .form-group {
  flex: 1;
}

/* Checkbox estilizado y alineado */
.form-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.form-checkbox-group input[type="checkbox"] {
  margin-top: 0.15rem;
  cursor: pointer;
}

.form-checkbox-group label {
  font-size: 0.825rem;
  color: #475569;
  line-height: 1.4;
  cursor: pointer;
}

/* Caja de opción/resumen dentro de la tarjeta */
.auth-option {
  padding: 0.85rem 1rem;
  background-color: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

/* Campos extra de una pasarela: solo visibles si su opción está marcada */
.form-checkbox-group:not(:has(input:checked)) + .gateway-extra {
  display: none;
}

.form-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.form-actions button.btn-auth-submit {
  display: inline-block;
  min-width: 70%;
  width: auto;
}

.form-actions button.btn-auth-submit-fullwith {
  width: 100%;
}

.form-actions .btn-cancel-link {
  display: inline-block;
  min-width: 20%;
  width: auto;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem !important; /* Proporción equilibrada */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  background: #e2e3e5;
  color: #333;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.15s ease-in-out;
}

.form-actions .btn-cancel-link:hover {
  background: #d6d8db;
}

/* Adaptación para pantallas móviles */
@media (max-width: 480px) {
  .auth-wrapper {
    padding: 1rem 1rem;
  }

  /* Tarjeta */
  .auth-card {
    padding: 1.5rem 1.5rem;
  }

  .form-row-2 {
    flex-direction: column;
    gap: 1.25rem;
  }
}

.auth-link-btn {
  background: none;
  border: none;
  color: #0056b3; /* El color azul de tus enlaces */
  text-decoration: underline;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  display: inline;
}
.auth-link-btn:hover {
  color: #003d7a;
}

/* Contador OTP */

/* Contenedor específico del Código QR */
.qr-container-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}

.qr-image {
  width: 180px;
  height: 180px;
  background: #ffffff;
  padding: 0.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.qr-secret-fallback {
  text-align: center;
  margin-top: 1rem;
  width: 100%;
}

.qr-secret-fallback small {
  display: block;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.qr-secret-fallback code {
  display: inline-block;
  background-color: #e2e8f0;
  color: #0f172a;
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* Bloque de alerta de error */
.auth-alert {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.auth-alert-danger {
  background-color: #fdf2f2;
  border: 1px solid #f87171;
  color: #991b1b;
}

.auth-alert .alert-icon {
  flex-shrink: 0;
  color: #ef4444;
}

.auth-alert-success {
  background-color: #dcfce7;
  border: 1px solid #86efac;
  color: #15803d;
}

.auth-alert .alert-icon-success {
  color: #10b981;
}
